<xml xmlns="http://www.w3.org/1999/xhtml" is_dbot="true" collection="false">
  <variables>
    <variable type="" id="pbMaxLoss" islocal="false" iscloud="false">Max Loss Amount</variable>
    <variable type="" id="pbExpProfit" islocal="false" iscloud="false">Expected Profit</variable>
    <variable type="" id="pbStake" islocal="false" iscloud="false">Stake</variable>
    <variable type="" id="pbBaseStake" islocal="false" iscloud="false">Base Stake</variable>
    <variable type="" id="pbMaxStake" islocal="false" iscloud="false">Max Stake</variable>
    <variable type="" id="pbLossStreak" islocal="false" iscloud="false">Loss Streak</variable>
    <variable type="" id="pbDigit" islocal="false" iscloud="false">Predicted Digit</variable>
    <variable type="" id="pbMessage" islocal="false" iscloud="false">Message</variable>
  </variables>

  <block type="trade_definition" id="pbTradeDef" deletable="false" x="0" y="0">
    <statement name="TRADE_OPTIONS">
      <block type="trade_definition_market" id="pbMarket" deletable="false" movable="false">
        <field name="MARKET_LIST">synthetic_index</field>
        <field name="SUBMARKET_LIST">random_index</field>
        <field name="SYMBOL_LIST">R_50</field>
        <next>
          <block type="trade_definition_tradetype" id="pbTradeType" deletable="false" movable="false">
            <field name="TRADETYPECAT_LIST">digits</field>
            <field name="TRADETYPE_LIST">matchesdiffers</field>
            <next>
              <block type="trade_definition_contracttype" id="pbContractType" deletable="false" movable="false">
                <field name="TYPE_LIST">DIGITDIFF</field>
                <next>
                  <block type="trade_definition_candleinterval" id="pbCandle" deletable="false" movable="false">
                    <field name="CANDLEINTERVAL_LIST">60</field>
                    <next>
                      <block type="trade_definition_restartbuysell" id="pbRestartBuy" deletable="false" movable="false">
                        <field name="TIME_MACHINE_ENABLED">FALSE</field>
                        <next>
                          <block type="trade_definition_restartonerror" id="pbRestartErr" deletable="false" movable="false">
                            <field name="RESTARTONERROR">TRUE</field>
                          </block>
                        </next>
                      </block>
                    </next>
                  </block>
                </next>
              </block>
            </next>
          </block>
        </next>
      </block>
    </statement>

    <statement name="INITIALIZATION">
      <block type="variables_set" id="pbInitMaxLoss">
        <field name="VAR" id="pbMaxLoss" variabletype="">Max Loss Amount</field>
        <value name="VALUE" strategy_value="loss">
          <block type="math_number" id="pbNumMaxLoss">
            <field name="NUM">10</field>
          </block>
        </value>
        <next>
          <block type="variables_set" id="pbInitExpProfit">
            <field name="VAR" id="pbExpProfit" variabletype="">Expected Profit</field>
            <value name="VALUE" strategy_value="profit">
              <block type="math_number" id="pbNumExpProfit">
                <field name="NUM">1</field>
              </block>
            </value>
            <next>
              <block type="variables_set" id="pbInitBase">
                <field name="VAR" id="pbBaseStake" variabletype="">Base Stake</field>
                <value name="VALUE" strategy_value="stake">
                  <block type="math_number" id="pbNumBase">
                    <field name="NUM">0.35</field>
                  </block>
                </value>
                <next>
                  <block type="variables_set" id="pbInitMaxStake">
                    <field name="VAR" id="pbMaxStake" variabletype="">Max Stake</field>
                    <value name="VALUE" strategy_value="max_stake">
                      <block type="math_number" id="pbNumMaxStake">
                        <field name="NUM">20</field>
                      </block>
                    </value>
                    <next>
                      <block type="variables_set" id="pbInitStake">
                        <field name="VAR" id="pbStake" variabletype="">Stake</field>
                        <value name="VALUE">
                          <block type="variables_get" id="pbGetBaseInit">
                            <field name="VAR" id="pbBaseStake" variabletype="">Base Stake</field>
                          </block>
                        </value>
                        <next>
                          <block type="variables_set" id="pbInitStreak">
                            <field name="VAR" id="pbLossStreak" variabletype="">Loss Streak</field>
                            <value name="VALUE">
                              <block type="math_number" id="pbNumStreak0">
                                <field name="NUM">0</field>
                              </block>
                            </value>
                            <next>
                              <block type="variables_set" id="pbInitDigit">
                                <field name="VAR" id="pbDigit" variabletype="">Predicted Digit</field>
                                <value name="VALUE">
                                  <block type="math_random_int" id="pbRandInit">
                                    <value name="FROM">
                                      <shadow type="math_number" id="pbRandInitFrom">
                                        <field name="NUM">0</field>
                                      </shadow>
                                    </value>
                                    <value name="TO">
                                      <shadow type="math_number" id="pbRandInitTo">
                                        <field name="NUM">9</field>
                                      </shadow>
                                    </value>
                                  </block>
                                </value>
                              </block>
                            </next>
                          </block>
                        </next>
                      </block>
                    </next>
                  </block>
                </next>
              </block>
            </next>
          </block>
        </next>
      </block>
    </statement>

    <statement name="SUBMARKET">
      <block type="trade_definition_tradeoptions" id="pbTradeOptions">
        <mutation has_first_barrier="false" has_second_barrier="false" has_prediction="true"></mutation>
        <field name="DURATIONTYPE_LIST">t</field>
        <value name="DURATION" strategy_value="duration">
          <shadow type="math_number" id="pbDurationNum">
            <field name="NUM">1</field>
          </shadow>
        </value>
        <value name="AMOUNT">
          <shadow type="math_number" id="pbAmountShadow">
            <field name="NUM">0.35</field>
          </shadow>
          <block type="variables_get" id="pbGetStake">
            <field name="VAR" id="pbStake" variabletype="">Stake</field>
          </block>
        </value>
        <value name="PREDICTION">
          <shadow type="math_number" id="pbPredShadow">
            <field name="NUM">1</field>
          </shadow>
          <block type="variables_get" id="pbGetDigit">
            <field name="VAR" id="pbDigit" variabletype="">Predicted Digit</field>
          </block>
        </value>
      </block>
    </statement>
  </block>

  <block type="before_purchase" id="pbBeforePurchase" x="0" y="700">
    <statement name="BEFOREPURCHASE_STACK">
      <block type="purchase" id="pbPurchase">
        <field name="PURCHASE_LIST">DIGITDIFF</field>
      </block>
    </statement>
  </block>

  <block type="after_purchase" id="pbAfterPurchase" x="0" y="900">
    <statement name="AFTERPURCHASE_STACK">
      <block type="controls_if" id="pbIfWin">
        <mutation else="1"></mutation>
        <value name="IF0">
          <block type="contract_check_result" id="pbCheckWin">
            <field name="CHECK_RESULT">win</field>
          </block>
        </value>

        <statement name="DO0">
          <block type="variables_set" id="pbWinResetStreak">
            <field name="VAR" id="pbLossStreak" variabletype="">Loss Streak</field>
            <value name="VALUE">
              <block type="math_number" id="pbWinStreak0">
                <field name="NUM">0</field>
              </block>
            </value>
            <next>
              <block type="variables_set" id="pbWinResetStake">
                <field name="VAR" id="pbStake" variabletype="">Stake</field>
                <value name="VALUE">
                  <block type="variables_get" id="pbWinGetBase">
                    <field name="VAR" id="pbBaseStake" variabletype="">Base Stake</field>
                  </block>
                </value>
                <next>
                  <block type="variables_set" id="pbWinNewDigit">
                    <field name="VAR" id="pbDigit" variabletype="">Predicted Digit</field>
                    <value name="VALUE">
                      <block type="math_random_int" id="pbWinRand">
                        <value name="FROM">
                          <shadow type="math_number" id="pbWinRandFrom">
                            <field name="NUM">0</field>
                          </shadow>
                        </value>
                        <value name="TO">
                          <shadow type="math_number" id="pbWinRandTo">
                            <field name="NUM">9</field>
                          </shadow>
                        </value>
                      </block>
                    </value>
                  </block>
                </next>
              </block>
            </next>
          </block>
        </statement>

        <statement name="ELSE">
          <block type="math_change" id="pbLossBumpStreak">
            <field name="VAR" id="pbLossStreak" variabletype="">Loss Streak</field>
            <value name="DELTA">
              <shadow type="math_number" id="pbLossStreakDelta">
                <field name="NUM">1</field>
              </shadow>
            </value>
            <next>
              <block type="controls_if" id="pbIfStreak">
                <mutation else="1"></mutation>
                <value name="IF0">
                  <block type="logic_compare" id="pbStreakCmp">
                    <field name="OP">GTE</field>
                    <value name="A">
                      <block type="variables_get" id="pbStreakGet">
                        <field name="VAR" id="pbLossStreak" variabletype="">Loss Streak</field>
                      </block>
                    </value>
                    <value name="B">
                      <block type="math_number" id="pbStreakLimit">
                        <field name="NUM">2</field>
                      </block>
                    </value>
                  </block>
                </value>

                <statement name="DO0">
                  <block type="variables_set" id="pbGiveUpStake">
                    <field name="VAR" id="pbStake" variabletype="">Stake</field>
                    <value name="VALUE">
                      <block type="variables_get" id="pbGiveUpBase">
                        <field name="VAR" id="pbBaseStake" variabletype="">Base Stake</field>
                      </block>
                    </value>
                    <next>
                      <block type="variables_set" id="pbGiveUpStreak">
                        <field name="VAR" id="pbLossStreak" variabletype="">Loss Streak</field>
                        <value name="VALUE">
                          <block type="math_number" id="pbGiveUpStreak0">
                            <field name="NUM">0</field>
                          </block>
                        </value>
                        <next>
                          <block type="variables_set" id="pbGiveUpDigit">
                            <field name="VAR" id="pbDigit" variabletype="">Predicted Digit</field>
                            <value name="VALUE">
                              <block type="math_random_int" id="pbGiveUpRand">
                                <value name="FROM">
                                  <shadow type="math_number" id="pbGiveUpRandFrom">
                                    <field name="NUM">0</field>
                                  </shadow>
                                </value>
                                <value name="TO">
                                  <shadow type="math_number" id="pbGiveUpRandTo">
                                    <field name="NUM">9</field>
                                  </shadow>
                                </value>
                              </block>
                            </value>
                          </block>
                        </next>
                      </block>
                    </next>
                  </block>
                </statement>

                <statement name="ELSE">
                  <block type="variables_set" id="pbRecoverStake">
                    <field name="VAR" id="pbStake" variabletype="">Stake</field>
                    <value name="VALUE">
                      <block type="math_arithmetic" id="pbRecoverMul">
                        <field name="OP">MULTIPLY</field>
                        <value name="A">
                          <shadow type="math_number" id="pbRecoverMulA">
                            <field name="NUM">1</field>
                          </shadow>
                          <block type="variables_get" id="pbRecoverGetStake">
                            <field name="VAR" id="pbStake" variabletype="">Stake</field>
                          </block>
                        </value>
                        <value name="B">
                          <shadow type="math_number" id="pbRecoverMulB">
                            <field name="NUM">11</field>
                          </shadow>
                        </value>
                      </block>
                    </value>
                    <next>
                      <block type="controls_if" id="pbIfCapStake">
                        <value name="IF0">
                          <block type="logic_compare" id="pbCapCmp">
                            <field name="OP">GT</field>
                            <value name="A">
                              <block type="variables_get" id="pbCapGetStake">
                                <field name="VAR" id="pbStake" variabletype="">Stake</field>
                              </block>
                            </value>
                            <value name="B">
                              <block type="variables_get" id="pbCapGetMax">
                                <field name="VAR" id="pbMaxStake" variabletype="">Max Stake</field>
                              </block>
                            </value>
                          </block>
                        </value>
                        <statement name="DO0">
                          <block type="variables_set" id="pbCapApply">
                            <field name="VAR" id="pbStake" variabletype="">Stake</field>
                            <value name="VALUE">
                              <block type="variables_get" id="pbCapApplyBase">
                                <field name="VAR" id="pbBaseStake" variabletype="">Base Stake</field>
                              </block>
                            </value>
                            <next>
                              <block type="variables_set" id="pbCapResetStreak">
                                <field name="VAR" id="pbLossStreak" variabletype="">Loss Streak</field>
                                <value name="VALUE">
                                  <block type="math_number" id="pbCapStreak0">
                                    <field name="NUM">0</field>
                                  </block>
                                </value>
                              </block>
                            </next>
                          </block>
                        </statement>
                      </block>
                    </next>
                  </block>
                </statement>
              </block>
            </next>
          </block>
        </statement>

        <next>
          <block type="text_join" id="pbJoinTotal">
            <field name="VARIABLE" id="pbMessage" variabletype="">Message</field>
            <statement name="STACK">
              <block type="text_statement" id="pbTsTotalA" movable="false">
                <value name="TEXT">
                  <shadow type="text" id="pbTxTotalA">
                    <field name="TEXT">Total profit:</field>
                  </shadow>
                </value>
                <next>
                  <block type="text_statement" id="pbTsTotalB" movable="false">
                    <value name="TEXT">
                      <shadow type="text" id="pbTxTotalB">
                        <field name="TEXT"></field>
                      </shadow>
                      <block type="total_profit" id="pbTotal1"></block>
                    </value>
                  </block>
                </next>
              </block>
            </statement>
            <next>
          <block type="notify" id="pbNotifyTotal">
            <field name="NOTIFICATION_TYPE">info</field>
            <field name="NOTIFICATION_SOUND">silent</field>
            <value name="MESSAGE">
              <shadow type="text" id="pbMsgShadowA">
                <field name="TEXT">abc</field>
              </shadow>
              <block type="variables_get" id="pbGetMsgA">
                <field name="VAR" id="pbMessage" variabletype="">Message</field>
              </block>
            </value>
            <next>
              <block type="controls_if" id="pbIfTargets">
                <mutation elseif="1" else="1"></mutation>
                <value name="IF0">
                  <block type="logic_compare" id="pbCmpProfit">
                    <field name="OP">GTE</field>
                    <value name="A">
                      <block type="total_profit" id="pbTotal2"></block>
                    </value>
                    <value name="B">
                      <block type="variables_get" id="pbGetExpProfit">
                        <field name="VAR" id="pbExpProfit" variabletype="">Expected Profit</field>
                      </block>
                    </value>
                  </block>
                </value>
                <statement name="DO0">
                  <block type="text_join" id="pbJoinTP">
                    <field name="VARIABLE" id="pbMessage" variabletype="">Message</field>
                    <statement name="STACK">
                      <block type="text_statement" id="pbTsTpA" movable="false">
                        <value name="TEXT">
                          <shadow type="text" id="pbTxTpA">
                            <field name="TEXT">Take profit reached, stopping. Total:</field>
                          </shadow>
                        </value>
                        <next>
                          <block type="text_statement" id="pbTsTpB" movable="false">
                            <value name="TEXT">
                              <shadow type="text" id="pbTxTpB">
                                <field name="TEXT"></field>
                              </shadow>
                              <block type="total_profit" id="pbTotal3"></block>
                            </value>
                          </block>
                        </next>
                      </block>
                    </statement>
                    <next>
                      <block type="notify" id="pbNotifyTPHit">
                        <field name="NOTIFICATION_TYPE">success</field>
                        <field name="NOTIFICATION_SOUND">silent</field>
                        <value name="MESSAGE">
                          <shadow type="text" id="pbMsgShadowB">
                            <field name="TEXT">abc</field>
                          </shadow>
                          <block type="variables_get" id="pbGetMsgB">
                            <field name="VAR" id="pbMessage" variabletype="">Message</field>
                          </block>
                        </value>
                      </block>
                    </next>
                  </block>
                </statement>

                <value name="IF1">
                  <block type="logic_compare" id="pbCmpLoss">
                    <field name="OP">LTE</field>
                    <value name="A">
                      <block type="total_profit" id="pbTotal4"></block>
                    </value>
                    <value name="B">
                      <block type="math_arithmetic" id="pbNegMaxLoss">
                        <field name="OP">MINUS</field>
                        <value name="A">
                          <shadow type="math_number" id="pbNegZero">
                            <field name="NUM">0</field>
                          </shadow>
                        </value>
                        <value name="B">
                          <shadow type="math_number" id="pbNegShadow">
                            <field name="NUM">10</field>
                          </shadow>
                          <block type="variables_get" id="pbGetMaxLoss">
                            <field name="VAR" id="pbMaxLoss" variabletype="">Max Loss Amount</field>
                          </block>
                        </value>
                      </block>
                    </value>
                  </block>
                </value>
                <statement name="DO1">
                  <block type="text_join" id="pbJoinSL">
                    <field name="VARIABLE" id="pbMessage" variabletype="">Message</field>
                    <statement name="STACK">
                      <block type="text_statement" id="pbTsSlA" movable="false">
                        <value name="TEXT">
                          <shadow type="text" id="pbTxSlA">
                            <field name="TEXT">Stop loss reached, stopping. Total:</field>
                          </shadow>
                        </value>
                        <next>
                          <block type="text_statement" id="pbTsSlB" movable="false">
                            <value name="TEXT">
                              <shadow type="text" id="pbTxSlB">
                                <field name="TEXT"></field>
                              </shadow>
                              <block type="total_profit" id="pbTotal5"></block>
                            </value>
                          </block>
                        </next>
                      </block>
                    </statement>
                    <next>
                      <block type="notify" id="pbNotifySLHit">
                        <field name="NOTIFICATION_TYPE">error</field>
                        <field name="NOTIFICATION_SOUND">silent</field>
                        <value name="MESSAGE">
                          <shadow type="text" id="pbMsgShadowC">
                            <field name="TEXT">abc</field>
                          </shadow>
                          <block type="variables_get" id="pbGetMsgC">
                            <field name="VAR" id="pbMessage" variabletype="">Message</field>
                          </block>
                        </value>
                      </block>
                    </next>
                  </block>
                </statement>

                <statement name="ELSE">
                  <block type="trade_again" id="pbTradeAgain"></block>
                </statement>
              </block>
            </next>
          </block>
        </next>
          </block>
        </next>
      </block>
    </statement>
  </block>

  <block type="during_purchase" id="pbDuringPurchase" x="0" y="1600"></block>
</xml>
