<xml xmlns="http://www.w3.org/1999/xhtml">
  <block type="variables_set" x="11" y="14">
    <field name="VAR">Expected Profit</field>
    <value name="VALUE">
      <block type="math_number">
        <field name="NUM">100</field>
      </block>
    </value>
    <next>
      <block type="variables_set">
        <field name="VAR">Win Amount</field>
        <value name="VALUE">
          <block type="math_number">
            <field name="NUM">20</field>
          </block>
        </value>
        <next>
          <block type="variables_set">
            <field name="VAR">Initial Amount</field>
            <value name="VALUE">
              <block type="math_number">
                <field name="NUM">20</field>
              </block>
            </value>
            <next>
              <block type="trade" id="trade" deletable="false">
                <field name="ACCOUNT_LIST"></field>
                <statement name="SUBMARKET">
                  <block type="r_100">
                    <statement name="CONDITION">
                      <block type="evenodd">
                        <field name="PAYOUTTYPE_LIST">stake</field>
                        <field name="CURRENCY_LIST">USD</field>
                        <value name="DURATION">
                          <block type="math_number">
                            <field name="NUM">5</field>
                          </block>
                        </value>
                        <value name="AMOUNT">
                          <block type="variables_get">
                            <field name="VAR">Initial Amount</field>
                          </block>
                        </value>
                      </block>
                    </statement>
                  </block>
                </statement>
              </block>
            </next>
          </block>
        </next>
      </block>
    </next>
  </block>
  <block type="on_strategy" id="strategy" deletable="false" x="395" y="16">
    <statement name="STRATEGY_STACK">
      <block type="purchase">
        <field name="PURCHASE_LIST">DIGITEVEN</field>
      </block>
    </statement>
  </block>
  <block type="on_finish" id="finish" deletable="false" x="395" y="86">
    <statement name="FINISH_STACK">
      <block type="controls_if">
        <mutation else="1"></mutation>
        <value name="IF0">
          <block type="contract_check_result">
            <field name="CHECK_RESULT">win</field>
          </block>
        </value>
        <statement name="DO0">
          <block type="notify">
            <field name="NOTIFICATION_TYPE">success</field>
            <value name="MESSAGE">
              <block type="text_join">
                <mutation items="2"></mutation>
                <value name="ADD0">
                  <block type="text">
                    <field name="TEXT">Won:</field>
                  </block>
                </value>
                <value name="ADD1">
                  <block type="read_details">
                    <field name="DETAIL_INDEX">4</field>
                  </block>
                </value>
              </block>
            </value>
            <next>
              <block type="variables_set">
                <field name="VAR">Initial Amount</field>
                <value name="VALUE">
                  <block type="variables_get">
                    <field name="VAR">Win Amount</field>
                  </block>
                </value>
              </block>
            </next>
          </block>
        </statement>
        <statement name="ELSE">
          <block type="notify">
            <field name="NOTIFICATION_TYPE">warn</field>
            <value name="MESSAGE">
              <block type="text_join">
                <mutation items="2"></mutation>
                <value name="ADD0">
                  <block type="text">
                    <field name="TEXT">Lost: </field>
                  </block>
                </value>
                <value name="ADD1">
                  <block type="math_single">
                    <field name="OP">ABS</field>
                    <value name="NUM">
                      <shadow type="math_number" id="GleSn`9j7Cm7/dqg}FIA">
                        <field name="NUM">9</field>
                      </shadow>
                      <block type="read_details">
                        <field name="DETAIL_INDEX">4</field>
                      </block>
                    </value>
                  </block>
                </value>
              </block>
            </value>
            <next>
              <block type="math_change">
                <field name="VAR">Initial Amount</field>
                <value name="DELTA">
                  <shadow type="math_number" id="N=Vo^MVz~/^(xt7Ag@8E">
                    <field name="NUM">1</field>
                  </shadow>
                  <block type="math_arithmetic">
                    <field name="OP">MULTIPLY</field>
                    <value name="A">
                      <shadow type="math_number" id="ka8n8|Dugz,q5FkUjs`7">
                        <field name="NUM">1</field>
                      </shadow>
                      <block type="math_single">
                        <field name="OP">ABS</field>
                        <value name="NUM">
                          <shadow type="math_number" id="GleSn`9j7Cm7/dqg}FIA">
                            <field name="NUM">9</field>
                          </shadow>
                          <block type="read_details">
                            <field name="DETAIL_INDEX">4</field>
                          </block>
                        </value>
                      </block>
                    </value>
                    <value name="B">
                      <shadow type="math_number" id="{JXdZCp2%s=sfO@yN:n}">
                        <field name="NUM">1</field>
                      </shadow>
                      <block type="math_number">
                        <field name="NUM">1.041</field>
                      </block>
                    </value>
                  </block>
                </value>
              </block>
            </next>
          </block>
        </statement>
        <next>
          <block type="notify">
            <field name="NOTIFICATION_TYPE">info</field>
            <value name="MESSAGE">
              <block type="text_join">
                <mutation items="2"></mutation>
                <value name="ADD0">
                  <block type="text">
                    <field name="TEXT">Total Profit: </field>
                  </block>
                </value>
                <value name="ADD1">
                  <block type="total_profit"></block>
                </value>
              </block>
            </value>
            <next>
              <block type="controls_if">
                <mutation else="1"></mutation>
                <value name="IF0">
                  <block type="logic_compare">
                    <field name="OP">LT</field>
                    <value name="A">
                      <block type="total_profit"></block>
                    </value>
                    <value name="B">
                      <block type="variables_get">
                        <field name="VAR">Expected Profit</field>
                      </block>
                    </value>
                  </block>
                </value>
                <statement name="DO0">
                  <block type="trade_again"></block>
                </statement>
                <statement name="ELSE">
                  <block type="text_print">
                    <value name="TEXT">
                      <shadow type="text" id="kqlrIk.GO.^}hI,PoUV)">
                        <field name="TEXT">abc</field>
                      </shadow>
                      <block type="text_join">
                        <mutation items="2"></mutation>
                        <value name="ADD0">
                          <block type="text">
                            <field name="TEXT">Done! Total profit: </field>
                          </block>
                        </value>
                        <value name="ADD1">
                          <block type="total_profit"></block>
                        </value>
                      </block>
                    </value>
                  </block>
                </statement>
              </block>
            </next>
          </block>
        </next>
      </block>
    </statement>
  </block>
</xml>
