<xml xmlns="https://developers.google.com/blockly/xml" is_dbot="true" collection="false">
  <variables>
    <variable id="dzl_var_stake">Stake</variable>
    <variable id="dzl_var_initial">initalStake</variable>
    <variable id="dzl_var_prediction">prediction</variable>
    <variable id="dzl_var_loss">lossCount</variable>
    <variable id="dzl_var_mg">Martingale split</variable>
    <variable id="dzl_var_pred_before">Prediction before loss</variable>
    <variable id="dzl_var_pred_after">prediction after loss</variable>
  </variables>
  <block type="trade_definition" id="dzl_trade_def" deletable="false" x="0" y="60">
    <statement name="TRADE_OPTIONS">
      <block type="trade_definition_market" id="dzl_market" deletable="false" movable="false">
        <field name="MARKET_LIST">synthetic_index</field>
        <field name="SUBMARKET_LIST">random_index</field>
        <field name="SYMBOL_LIST">1HZ50V</field>
        <next>
          <block type="trade_definition_tradetype" id="dzl_tradetype" deletable="false" movable="false">
            <field name="TRADETYPECAT_LIST">digits</field>
            <field name="TRADETYPE_LIST">overunder</field>
            <next>
              <block type="trade_definition_contracttype" id="dzl_contracttype" deletable="false" movable="false">
                <field name="TYPE_LIST">DIGITOVER</field>
                <next>
                  <block type="trade_definition_candleinterval" id="dzl_candle" deletable="false" movable="false">
                    <field name="CANDLEINTERVAL_LIST">60</field>
                    <next>
                      <block type="trade_definition_restartbuysell" id="dzl_restart_bs" deletable="false" movable="false">
                        <field name="TIME_MACHINE_ENABLED">FALSE</field>
                        <next>
                          <block type="trade_definition_restartonerror" id="dzl_restart_err" 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="dzl_init_stake">
        <field name="VAR" id="dzl_var_stake">Stake</field>
        <value name="VALUE">
          <block type="math_number" id="dzl_init_stake_n">
            <field name="NUM">2</field>
          </block>
        </value>
        <next>
          <block type="variables_set" id="dzl_init_initial">
            <field name="VAR" id="dzl_var_initial">initalStake</field>
            <value name="VALUE">
              <block type="math_number" id="dzl_init_initial_n">
                <field name="NUM">2</field>
              </block>
            </value>
            <next>
              <block type="variables_set" id="dzl_init_mg">
                <field name="VAR" id="dzl_var_mg">Martingale split</field>
                <value name="VALUE">
                  <block type="math_number" id="dzl_init_mg_n">
                    <field name="NUM">2</field>
                  </block>
                </value>
                <next>
                  <block type="variables_set" id="dzl_init_pred_before">
                    <field name="VAR" id="dzl_var_pred_before">Prediction before loss</field>
                    <value name="VALUE">
                      <block type="math_number" id="dzl_init_pred_before_n">
                        <field name="NUM">2</field>
                      </block>
                    </value>
                    <next>
                      <block type="variables_set" id="dzl_init_pred_after">
                        <field name="VAR" id="dzl_var_pred_after">prediction after loss</field>
                        <value name="VALUE">
                          <block type="math_number" id="dzl_init_pred_after_n">
                            <field name="NUM">2</field>
                          </block>
                        </value>
                        <next>
                          <block type="variables_set" id="dzl_init_loss">
                            <field name="VAR" id="dzl_var_loss">lossCount</field>
                            <value name="VALUE">
                              <block type="math_number" id="dzl_init_loss_n">
                                <field name="NUM">0</field>
                              </block>
                            </value>
                          </block>
                        </next>
                      </block>
                    </next>
                  </block>
                </next>
              </block>
            </next>
          </block>
        </next>
      </block>
    </statement>
    <statement name="SUBMARKET">
      <block type="controls_if" id="dzl_sub_if">
        <mutation xmlns="http://www.w3.org/1999/xhtml" else="1"></mutation>
        <value name="IF0">
          <block type="logic_compare" id="dzl_sub_cmp0">
            <field name="OP">EQ</field>
            <value name="A">
              <block type="variables_get" id="dzl_sub_loss_g0">
                <field name="VAR" id="dzl_var_loss">lossCount</field>
              </block>
            </value>
            <value name="B">
              <block type="math_number" id="dzl_sub_zero">
                <field name="NUM">0</field>
              </block>
            </value>
          </block>
        </value>
        <statement name="DO0">
          <block type="variables_set" id="dzl_sub_set_pred0">
            <field name="VAR" id="dzl_var_prediction">prediction</field>
            <value name="VALUE">
              <block type="variables_get" id="dzl_sub_pred_before_g">
                <field name="VAR" id="dzl_var_pred_before">Prediction before loss</field>
              </block>
            </value>
          </block>
        </statement>
        <statement name="ELSE">
          <block type="controls_if" id="dzl_sub_if1">
            <value name="IF0">
              <block type="logic_compare" id="dzl_sub_cmp1">
                <field name="OP">EQ</field>
                <value name="A">
                  <block type="variables_get" id="dzl_sub_loss_g1">
                    <field name="VAR" id="dzl_var_loss">lossCount</field>
                  </block>
                </value>
                <value name="B">
                  <block type="math_number" id="dzl_sub_one">
                    <field name="NUM">1</field>
                  </block>
                </value>
              </block>
            </value>
            <statement name="DO0">
              <block type="variables_set" id="dzl_sub_set_pred1">
                <field name="VAR" id="dzl_var_prediction">prediction</field>
                <value name="VALUE">
                  <block type="variables_get" id="dzl_sub_pred_after_g">
                    <field name="VAR" id="dzl_var_pred_after">prediction after loss</field>
                  </block>
                </value>
              </block>
            </statement>
          </block>
        </statement>
        <next>
          <block type="trade_definition_tradeoptions" id="dzl_tradeoptions">
            <mutation xmlns="http://www.w3.org/1999/xhtml" has_first_barrier="false" has_second_barrier="false" has_prediction="true"></mutation>
            <field name="DURATIONTYPE_LIST">t</field>
            <value name="DURATION">
              <shadow type="math_number" id="dzl_dur_shadow">
                <field name="NUM">1</field>
              </shadow>
              <block type="math_number" id="dzl_duration">
                <field name="NUM">1</field>
              </block>
            </value>
            <value name="AMOUNT">
              <shadow type="math_number" id="dzl_amt_shadow">
                <field name="NUM">1</field>
              </shadow>
              <block type="variables_get" id="dzl_amt_stake">
                <field name="VAR" id="dzl_var_stake">Stake</field>
              </block>
            </value>
            <value name="PREDICTION">
              <shadow type="math_number_positive" id="dzl_pred_shadow">
                <field name="NUM">2</field>
              </shadow>
              <block type="variables_get" id="dzl_pred_var">
                <field name="VAR" id="dzl_var_prediction">prediction</field>
              </block>
            </value>
          </block>
        </next>
      </block>
    </statement>
  </block>
  <block type="after_purchase" id="dzl_after" x="722" y="60">
    <statement name="AFTERPURCHASE_STACK">
      <block type="controls_if" id="dzl_after_if">
        <mutation xmlns="http://www.w3.org/1999/xhtml" else="1"></mutation>
        <value name="IF0">
          <block type="contract_check_result" id="dzl_after_win">
            <field name="CHECK_RESULT">win</field>
          </block>
        </value>
        <statement name="DO0">
          <block type="variables_set" id="dzl_after_reset_loss">
            <field name="VAR" id="dzl_var_loss">lossCount</field>
            <value name="VALUE">
              <block type="math_number" id="dzl_after_zero">
                <field name="NUM">0</field>
              </block>
            </value>
            <next>
              <block type="variables_set" id="dzl_after_reset_stake">
                <field name="VAR" id="dzl_var_stake">Stake</field>
                <value name="VALUE">
                  <block type="variables_get" id="dzl_after_initial_g">
                    <field name="VAR" id="dzl_var_initial">initalStake</field>
                  </block>
                </value>
              </block>
            </next>
          </block>
        </statement>
        <statement name="ELSE">
          <block type="variables_set" id="dzl_after_mg_stake">
            <field name="VAR" id="dzl_var_stake">Stake</field>
            <value name="VALUE">
              <block type="math_arithmetic" id="dzl_after_mg_mul">
                <field name="OP">MULTIPLY</field>
                <value name="A">
                  <shadow type="math_number" id="dzl_after_mg_a_shadow">
                    <field name="NUM">1</field>
                  </shadow>
                  <block type="variables_get" id="dzl_after_stake_g">
                    <field name="VAR" id="dzl_var_stake">Stake</field>
                  </block>
                </value>
                <value name="B">
                  <shadow type="math_number" id="dzl_after_mg_b_shadow">
                    <field name="NUM">2</field>
                  </shadow>
                  <block type="variables_get" id="dzl_after_mg_g">
                    <field name="VAR" id="dzl_var_mg">Martingale split</field>
                  </block>
                </value>
              </block>
            </value>
            <next>
              <block type="math_change" id="dzl_after_loss_inc">
                <field name="VAR" id="dzl_var_loss">lossCount</field>
                <value name="DELTA">
                  <shadow type="math_number" id="dzl_after_delta">
                    <field name="NUM">1</field>
                  </shadow>
                </value>
              </block>
            </next>
          </block>
        </statement>
        <next>
          <block type="trade_again" id="dzl_trade_again"></block>
        </next>
      </block>
    </statement>
  </block>
  <block type="before_purchase" id="dzl_before" deletable="false" x="0" y="1248">
    <statement name="BEFOREPURCHASE_STACK">
      <block type="strategy_scan_digit_zone_lock" id="dzl_scan_all">
        <value name="TICK_COUNT">
          <shadow type="math_number" id="dzl_scan_ticks_shadow">
            <field name="NUM">1000</field>
          </shadow>
          <block type="math_number" id="dzl_scan_ticks">
            <field name="NUM">1000</field>
          </block>
        </value>
        <value name="BELOW_PCT">
          <shadow type="math_number" id="dzl_scan_below_shadow">
            <field name="NUM">10.5</field>
          </shadow>
          <block type="math_number" id="dzl_scan_below">
            <field name="NUM">10.5</field>
          </block>
        </value>
        <value name="ABOVE_PCT">
          <shadow type="math_number" id="dzl_scan_above_shadow">
            <field name="NUM">10.6</field>
          </shadow>
          <block type="math_number" id="dzl_scan_above">
            <field name="NUM">10.6</field>
          </block>
        </value>
        <next>
          <block type="strategy_digit_zone_lock_apply" id="dzl_zone_lock">
            <value name="TICK_COUNT">
              <shadow type="math_number" id="dzl_ticks_shadow">
                <field name="NUM">1000</field>
              </shadow>
              <block type="math_number" id="dzl_ticks">
                <field name="NUM">1000</field>
              </block>
            </value>
            <value name="BELOW_PCT">
              <shadow type="math_number" id="dzl_below_shadow">
                <field name="NUM">10.5</field>
              </shadow>
              <block type="math_number" id="dzl_below">
                <field name="NUM">10.5</field>
              </block>
            </value>
            <value name="ABOVE_PCT">
              <shadow type="math_number" id="dzl_above_shadow">
                <field name="NUM">10.6</field>
              </shadow>
              <block type="math_number" id="dzl_above">
                <field name="NUM">10.6</field>
              </block>
            </value>
            <next>
              <block type="purchase" id="dzl_purchase">
                <field name="PURCHASE_LIST">DIGITOVER</field>
              </block>
            </next>
          </block>
        </next>
      </block>
    </statement>
  </block>
</xml>
