<xml xmlns="http://www.w3.org/1999/xhtml" is_dbot="true" collection="false">
  <variables>
    <variable type="" id="pprfBaseStake" islocal="false" iscloud="false">Base Stake</variable>
    <variable type="" id="pprfStake" islocal="false" iscloud="false">Stake</variable>
    <variable type="" id="pprfRecoveryMul" islocal="false" iscloud="false">Recovery Multiplier</variable>
    <variable type="" id="pprfMaxStake" islocal="false" iscloud="false">Max Stake</variable>
    <variable type="" id="pprfLossStreak" islocal="false" iscloud="false">Loss Streak</variable>
    <variable type="" id="pprfTakeProfit" islocal="false" iscloud="false">Take Profit</variable>
    <variable type="" id="pprfMaxLoss" islocal="false" iscloud="false">Max Loss</variable>
    <variable type="" id="pprfSide" islocal="false" iscloud="false">Side</variable>
    <variable type="" id="pprfMessage" islocal="false" iscloud="false">Message</variable>
  </variables>

  <block type="trade_definition" id="pprfTradeDef" deletable="false" x="0" y="0">
    <statement name="TRADE_OPTIONS">
      <block type="trade_definition_market" id="pprfMarket" deletable="false" movable="false">
        <field name="MARKET_LIST">synthetic_index</field>
        <field name="SUBMARKET_LIST">random_index</field>
        <field name="SYMBOL_LIST">R_100</field>
        <next>
          <block type="trade_definition_tradetype" id="pprfTradeType" deletable="false" movable="false">
            <field name="TRADETYPECAT_LIST">callput</field>
            <field name="TRADETYPE_LIST">callput</field>
            <next>
              <block type="trade_definition_contracttype" id="pprfContractType" deletable="false" movable="false">
                <field name="TYPE_LIST">both</field>
                <next>
                  <block type="trade_definition_candleinterval" id="pprfCandle" deletable="false" movable="false">
                    <field name="CANDLEINTERVAL_LIST">60</field>
                    <next>
                      <block type="trade_definition_restartbuysell" id="pprfRestartBuy" deletable="false" movable="false">
                        <field name="TIME_MACHINE_ENABLED">FALSE</field>
                        <next>
                          <block type="trade_definition_restartonerror" id="pprfRestartErr" 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="pprfInitBase">
        <field name="VAR" id="pprfBaseStake" variabletype="">Base Stake</field>
        <value name="VALUE" strategy_value="stake">
          <block type="math_number" id="pprfNumBase">
            <field name="NUM">1</field>
          </block>
        </value>
        <next>
          <block type="variables_set" id="pprfInitRecoveryMul">
            <field name="VAR" id="pprfRecoveryMul" variabletype="">Recovery Multiplier</field>
            <value name="VALUE">
              <block type="math_number" id="pprfNumRecoveryMul">
                <field name="NUM">2.1</field>
              </block>
            </value>
            <next>
              <block type="variables_set" id="pprfInitMaxStake">
                <field name="VAR" id="pprfMaxStake" variabletype="">Max Stake</field>
                <value name="VALUE" strategy_value="max_stake">
                  <block type="math_number" id="pprfNumMaxStake">
                    <field name="NUM">2.1</field>
                  </block>
                </value>
                <next>
                  <block type="variables_set" id="pprfInitTakeProfit">
                    <field name="VAR" id="pprfTakeProfit" variabletype="">Take Profit</field>
                    <value name="VALUE" strategy_value="profit">
                      <block type="math_number" id="pprfNumTakeProfit">
                        <field name="NUM">2</field>
                      </block>
                    </value>
                    <next>
                      <block type="variables_set" id="pprfInitMaxLoss">
                        <field name="VAR" id="pprfMaxLoss" variabletype="">Max Loss</field>
                        <value name="VALUE" strategy_value="loss">
                          <block type="math_number" id="pprfNumMaxLoss">
                            <field name="NUM">6</field>
                          </block>
                        </value>
                        <next>
                          <block type="variables_set" id="pprfInitStake">
                            <field name="VAR" id="pprfStake" variabletype="">Stake</field>
                            <value name="VALUE">
                              <block type="variables_get" id="pprfGetBaseInit">
                                <field name="VAR" id="pprfBaseStake" variabletype="">Base Stake</field>
                              </block>
                            </value>
                            <next>
                              <block type="variables_set" id="pprfInitStreak">
                                <field name="VAR" id="pprfLossStreak" variabletype="">Loss Streak</field>
                                <value name="VALUE">
                                  <block type="math_number" id="pprfNumStreak0">
                                    <field name="NUM">0</field>
                                  </block>
                                </value>
                                <next>
                                  <block type="variables_set" id="pprfInitSide">
                                    <field name="VAR" id="pprfSide" variabletype="">Side</field>
                                    <value name="VALUE">
                                      <block type="math_number" id="pprfNumSide1">
                                        <field name="NUM">1</field>
                                      </block>
                                    </value>
                                  </block>
                                </next>
                              </block>
                            </next>
                          </block>
                        </next>
                      </block>
                    </next>
                  </block>
                </next>
              </block>
            </next>
          </block>
        </next>
      </block>
    </statement>

    <statement name="SUBMARKET">
      <block type="trade_definition_tradeoptions" id="pprfTradeOptions">
        <mutation has_first_barrier="false" has_second_barrier="false" has_prediction="false"></mutation>
        <field name="DURATIONTYPE_LIST">t</field>
        <field name="CURRENCY_LIST">USD</field>
        <value name="DURATION" strategy_value="duration">
          <shadow type="math_number" id="pprfDurationNum">
            <field name="NUM">5</field>
          </shadow>
        </value>
        <value name="AMOUNT">
          <shadow type="math_number" id="pprfAmountShadow">
            <field name="NUM">1</field>
          </shadow>
          <block type="variables_get" id="pprfGetStake">
            <field name="VAR" id="pprfStake" variabletype="">Stake</field>
          </block>
        </value>
      </block>
    </statement>
  </block>

  <block type="before_purchase" id="pprfBeforePurchase" x="0" y="800">
    <statement name="BEFOREPURCHASE_STACK">
      <block type="controls_if" id="pprfIfSide">
        <mutation else="1"></mutation>
        <value name="IF0">
          <block type="logic_compare" id="pprfSideCmp">
            <field name="OP">EQ</field>
            <value name="A">
              <block type="variables_get" id="pprfSideGet">
                <field name="VAR" id="pprfSide" variabletype="">Side</field>
              </block>
            </value>
            <value name="B">
              <block type="math_number" id="pprfSideCmpNum">
                <field name="NUM">1</field>
              </block>
            </value>
          </block>
        </value>
        <statement name="DO0">
          <block type="purchase" id="pprfPurchaseCall">
            <field name="PURCHASE_LIST">CALL</field>
          </block>
        </statement>
        <statement name="ELSE">
          <block type="purchase" id="pprfPurchasePut">
            <field name="PURCHASE_LIST">PUT</field>
          </block>
        </statement>
      </block>
    </statement>
  </block>

  <block type="after_purchase" id="pprfAfterPurchase" x="0" y="1100">
    <statement name="AFTERPURCHASE_STACK">
      <block type="controls_if" id="pprfIfWin">
        <mutation else="1"></mutation>
        <value name="IF0">
          <block type="contract_check_result" id="pprfCheckWin">
            <field name="CHECK_RESULT">win</field>
          </block>
        </value>

        <statement name="DO0">
          <block type="variables_set" id="pprfWinResetStreak">
            <field name="VAR" id="pprfLossStreak" variabletype="">Loss Streak</field>
            <value name="VALUE">
              <block type="math_number" id="pprfWinStreak0">
                <field name="NUM">0</field>
              </block>
            </value>
            <next>
              <block type="variables_set" id="pprfWinResetStake">
                <field name="VAR" id="pprfStake" variabletype="">Stake</field>
                <value name="VALUE">
                  <block type="variables_get" id="pprfWinGetBase">
                    <field name="VAR" id="pprfBaseStake" variabletype="">Base Stake</field>
                  </block>
                </value>
              </block>
            </next>
          </block>
        </statement>

        <statement name="ELSE">
          <block type="math_change" id="pprfLossBumpStreak">
            <field name="VAR" id="pprfLossStreak" variabletype="">Loss Streak</field>
            <value name="DELTA">
              <shadow type="math_number" id="pprfLossStreakDelta">
                <field name="NUM">1</field>
              </shadow>
            </value>
            <next>
              <block type="variables_set" id="pprfFlipSide">
                <field name="VAR" id="pprfSide" variabletype="">Side</field>
                <value name="VALUE">
                  <block type="math_arithmetic" id="pprfFlipMinus">
                    <field name="OP">MINUS</field>
                    <value name="A">
                      <shadow type="math_number" id="pprfFlipOne">
                        <field name="NUM">1</field>
                      </shadow>
                    </value>
                    <value name="B">
                      <shadow type="math_number" id="pprfFlipShadow">
                        <field name="NUM">1</field>
                      </shadow>
                      <block type="variables_get" id="pprfFlipGetSide">
                        <field name="VAR" id="pprfSide" variabletype="">Side</field>
                      </block>
                    </value>
                  </block>
                </value>
                <next>
                  <block type="controls_if" id="pprfIfStreak">
                    <mutation else="1"></mutation>
                    <value name="IF0">
                      <block type="logic_compare" id="pprfStreakCmp">
                        <field name="OP">GTE</field>
                        <value name="A">
                          <block type="variables_get" id="pprfStreakGet">
                            <field name="VAR" id="pprfLossStreak" variabletype="">Loss Streak</field>
                          </block>
                        </value>
                        <value name="B">
                          <block type="math_number" id="pprfStreakLimit">
                            <field name="NUM">2</field>
                          </block>
                        </value>
                      </block>
                    </value>

                    <statement name="DO0">
                      <block type="variables_set" id="pprfGiveUpStake">
                        <field name="VAR" id="pprfStake" variabletype="">Stake</field>
                        <value name="VALUE">
                          <block type="variables_get" id="pprfGiveUpBase">
                            <field name="VAR" id="pprfBaseStake" variabletype="">Base Stake</field>
                          </block>
                        </value>
                        <next>
                          <block type="variables_set" id="pprfGiveUpStreak">
                            <field name="VAR" id="pprfLossStreak" variabletype="">Loss Streak</field>
                            <value name="VALUE">
                              <block type="math_number" id="pprfGiveUpStreak0">
                                <field name="NUM">0</field>
                              </block>
                            </value>
                          </block>
                        </next>
                      </block>
                    </statement>

                    <statement name="ELSE">
                      <block type="variables_set" id="pprfRecoverStake">
                        <field name="VAR" id="pprfStake" variabletype="">Stake</field>
                        <value name="VALUE">
                          <block type="math_arithmetic" id="pprfRecoverMul">
                            <field name="OP">MULTIPLY</field>
                            <value name="A">
                              <shadow type="math_number" id="pprfRecoverMulA">
                                <field name="NUM">1</field>
                              </shadow>
                              <block type="variables_get" id="pprfRecoverGetStake">
                                <field name="VAR" id="pprfStake" variabletype="">Stake</field>
                              </block>
                            </value>
                            <value name="B">
                              <shadow type="math_number" id="pprfRecoverMulB">
                                <field name="NUM">2.1</field>
                              </shadow>
                              <block type="variables_get" id="pprfRecoverGetMul">
                                <field name="VAR" id="pprfRecoveryMul" variabletype="">Recovery Multiplier</field>
                              </block>
                            </value>
                          </block>
                        </value>
                        <next>
                          <block type="controls_if" id="pprfIfCapStake">
                            <value name="IF0">
                              <block type="logic_compare" id="pprfCapCmp">
                                <field name="OP">GT</field>
                                <value name="A">
                                  <block type="variables_get" id="pprfCapGetStake">
                                    <field name="VAR" id="pprfStake" variabletype="">Stake</field>
                                  </block>
                                </value>
                                <value name="B">
                                  <block type="variables_get" id="pprfCapGetMax">
                                    <field name="VAR" id="pprfMaxStake" variabletype="">Max Stake</field>
                                  </block>
                                </value>
                              </block>
                            </value>
                            <statement name="DO0">
                              <block type="variables_set" id="pprfCapApply">
                                <field name="VAR" id="pprfStake" variabletype="">Stake</field>
                                <value name="VALUE">
                                  <block type="variables_get" id="pprfCapApplyBase">
                                    <field name="VAR" id="pprfBaseStake" variabletype="">Base Stake</field>
                                  </block>
                                </value>
                                <next>
                                  <block type="variables_set" id="pprfCapResetStreak">
                                    <field name="VAR" id="pprfLossStreak" variabletype="">Loss Streak</field>
                                    <value name="VALUE">
                                      <block type="math_number" id="pprfCapStreak0">
                                        <field name="NUM">0</field>
                                      </block>
                                    </value>
                                  </block>
                                </next>
                              </block>
                            </statement>
                          </block>
                        </next>
                      </block>
                    </statement>
                  </block>
                </next>
              </block>
            </next>
          </block>
        </statement>

        <next>
          <block type="text_join" id="pprfJoinTotal">
            <field name="VARIABLE" id="pprfMessage" variabletype="">Message</field>
            <statement name="STACK">
              <block type="text_statement" id="pprfTsTotalA" movable="false">
                <value name="TEXT">
                  <shadow type="text" id="pprfTxTotalA">
                    <field name="TEXT">Total profit:</field>
                  </shadow>
                </value>
                <next>
                  <block type="text_statement" id="pprfTsTotalB" movable="false">
                    <value name="TEXT">
                      <shadow type="text" id="pprfTxTotalB">
                        <field name="TEXT"></field>
                      </shadow>
                      <block type="total_profit" id="pprfTotal1"></block>
                    </value>
                  </block>
                </next>
              </block>
            </statement>
            <next>
              <block type="notify" id="pprfNotifyTotal">
                <field name="NOTIFICATION_TYPE">info</field>
                <field name="NOTIFICATION_SOUND">silent</field>
                <value name="MESSAGE">
                  <shadow type="text" id="pprfMsgShadowA">
                    <field name="TEXT">abc</field>
                  </shadow>
                  <block type="variables_get" id="pprfGetMsgA">
                    <field name="VAR" id="pprfMessage" variabletype="">Message</field>
                  </block>
                </value>
                <next>
                  <block type="controls_if" id="pprfIfTargets">
                    <mutation elseif="1" else="1"></mutation>
                    <value name="IF0">
                      <block type="logic_compare" id="pprfCmpProfit">
                        <field name="OP">GTE</field>
                        <value name="A">
                          <block type="total_profit" id="pprfTotal2"></block>
                        </value>
                        <value name="B">
                          <block type="variables_get" id="pprfGetTakeProfit">
                            <field name="VAR" id="pprfTakeProfit" variabletype="">Take Profit</field>
                          </block>
                        </value>
                      </block>
                    </value>
                    <statement name="DO0">
                      <block type="text_join" id="pprfJoinTP">
                        <field name="VARIABLE" id="pprfMessage" variabletype="">Message</field>
                        <statement name="STACK">
                          <block type="text_statement" id="pprfTsTpA" movable="false">
                            <value name="TEXT">
                              <shadow type="text" id="pprfTxTpA">
                                <field name="TEXT">Take profit reached, stopping. Total:</field>
                              </shadow>
                            </value>
                            <next>
                              <block type="text_statement" id="pprfTsTpB" movable="false">
                                <value name="TEXT">
                                  <shadow type="text" id="pprfTxTpB">
                                    <field name="TEXT"></field>
                                  </shadow>
                                  <block type="total_profit" id="pprfTotal3"></block>
                                </value>
                              </block>
                            </next>
                          </block>
                        </statement>
                        <next>
                          <block type="notify" id="pprfNotifyTPHit">
                            <field name="NOTIFICATION_TYPE">success</field>
                            <field name="NOTIFICATION_SOUND">silent</field>
                            <value name="MESSAGE">
                              <shadow type="text" id="pprfMsgShadowB">
                                <field name="TEXT">abc</field>
                              </shadow>
                              <block type="variables_get" id="pprfGetMsgB">
                                <field name="VAR" id="pprfMessage" variabletype="">Message</field>
                              </block>
                            </value>
                          </block>
                        </next>
                      </block>
                    </statement>

                    <value name="IF1">
                      <block type="logic_compare" id="pprfCmpLoss">
                        <field name="OP">LTE</field>
                        <value name="A">
                          <block type="total_profit" id="pprfTotal4"></block>
                        </value>
                        <value name="B">
                          <block type="math_arithmetic" id="pprfNegMaxLoss">
                            <field name="OP">MINUS</field>
                            <value name="A">
                              <shadow type="math_number" id="pprfNegZero">
                                <field name="NUM">0</field>
                              </shadow>
                            </value>
                            <value name="B">
                              <shadow type="math_number" id="pprfNegShadow">
                                <field name="NUM">6</field>
                              </shadow>
                              <block type="variables_get" id="pprfGetMaxLoss">
                                <field name="VAR" id="pprfMaxLoss" variabletype="">Max Loss</field>
                              </block>
                            </value>
                          </block>
                        </value>
                      </block>
                    </value>
                    <statement name="DO1">
                      <block type="text_join" id="pprfJoinSL">
                        <field name="VARIABLE" id="pprfMessage" variabletype="">Message</field>
                        <statement name="STACK">
                          <block type="text_statement" id="pprfTsSlA" movable="false">
                            <value name="TEXT">
                              <shadow type="text" id="pprfTxSlA">
                                <field name="TEXT">Stop loss reached, stopping. Total:</field>
                              </shadow>
                            </value>
                            <next>
                              <block type="text_statement" id="pprfTsSlB" movable="false">
                                <value name="TEXT">
                                  <shadow type="text" id="pprfTxSlB">
                                    <field name="TEXT"></field>
                                  </shadow>
                                  <block type="total_profit" id="pprfTotal5"></block>
                                </value>
                              </block>
                            </next>
                          </block>
                        </statement>
                        <next>
                          <block type="notify" id="pprfNotifySLHit">
                            <field name="NOTIFICATION_TYPE">error</field>
                            <field name="NOTIFICATION_SOUND">silent</field>
                            <value name="MESSAGE">
                              <shadow type="text" id="pprfMsgShadowC">
                                <field name="TEXT">abc</field>
                              </shadow>
                              <block type="variables_get" id="pprfGetMsgC">
                                <field name="VAR" id="pprfMessage" variabletype="">Message</field>
                              </block>
                            </value>
                          </block>
                        </next>
                      </block>
                    </statement>

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

  <block type="during_purchase" id="pprfDuringPurchase" x="0" y="1900"></block>
</xml>
