﻿<xml xmlns="http://www.w3.org/1999/xhtml" collection="false">
  <block type="loader" id="l9;z(KA,X4wl}.C$%!6V" x="0" y="0">
    <field name="URL">https://gist.githubusercontent.com/binary-ex-machina/53c01f08106c45d586e24a7deabb5b81/raw/33e78094ac35d947fe94664d2fbd88419fef4a7c/exmachina-martingale.xml</field>
  </block>
  <block type="trade" id="xgH69|xFn9=70w.*3Vo@" x="0" y="53">
    <field name="MARKET_LIST">volidx</field>
    <field name="SUBMARKET_LIST">random_index</field>
    <field name="SYMBOL_LIST">R_100</field>
    <field name="TRADETYPECAT_LIST">callput</field>
    <field name="TRADETYPE_LIST">risefall</field>
    <field name="TYPE_LIST">both</field>
    <field name="CANDLEINTERVAL_LIST">60</field>
    <field name="TIME_MACHINE_ENABLED">FALSE</field>
    <field name="RESTARTONERROR">TRUE</field>
    <statement name="INITIALIZATION">
      <block type="procedures_callnoreturn" id="HM79}/=#G}o@/!*`)30,">
        <mutation name="exMachina::ConfigMartingale (1)">
          <arg name="_targetProfit (ex: 25)"></arg>
          <arg name="_stopLoss (ex: 200)"></arg>
          <arg name="_initialStake (ex: 1)"></arg>
          <arg name="_martingale (ex: 1.06)"></arg>
        </mutation>
        <value name="ARG0">
          <block type="math_number" id="6]-dr@$||)SD(aCN$I3Q">
            <field name="NUM">1</field>
          </block>
        </value>
        <value name="ARG1">
          <block type="math_number" id=";Q0~A2+L+~.xr8%XRWD^">
            <field name="NUM">30</field>
          </block>
        </value>
        <value name="ARG2">
          <block type="math_number" id=";mDc!4xI-^=9J7Y[#P41">
            <field name="NUM">1</field>
          </block>
        </value>
        <value name="ARG3">
          <block type="math_number" id="}0ht.+N`Q[Zt2CDpw/2v">
            <field name="NUM">1.06</field>
          </block>
        </value>
      </block>
    </statement>
    <statement name="SUBMARKET">
      <block type="tradeOptions" id="x=V33~4Lb|(sLv`J[:Eb">
        <field name="DURATIONTYPE_LIST">t</field>
        <field name="CURRENCY_LIST">USD</field>
        <value name="DURATION">
          <shadow type="math_number" id="O*@58sDc=!cOO}*b2vf9">
            <field name="NUM">5</field>
          </shadow>
        </value>
        <value name="AMOUNT">
          <shadow type="math_number" id="ml)25~7^q}3I9}vjf:%K">
            <field name="NUM">1</field>
          </shadow>
          <block type="procedures_callreturn" id="$_A?DD(,lLhrNZ7zH!n.">
            <mutation name="exMachina::Stake"></mutation>
          </block>
        </value>
      </block>
    </statement>
  </block>
  <block type="before_purchase" id="i-CIx.(Onm4?ihxzA}Y]" x="0" y="458">
    <statement name="BEFOREPURCHASE_STACK">
      <block type="controls_if" id="^WY8n#`8.G5sWPOx){6#">
        <mutation elseif="1"></mutation>
        <value name="IF0">
          <block type="logic_compare" id="`w*B*ZD?OR^KO?Xvt7(Q">
            <field name="OP">EQ</field>
            <value name="A">
              <block type="is_candle_black" id="7`PDO#+1dKf,%j2XU,Zc">
                <value name="OHLCOBJ">
                  <block type="lists_getIndex" id="{iD6Wy,2E?G6hI4n@?{k">
                    <mutation statement="false" at="false"></mutation>
                    <field name="MODE">GET</field>
                    <field name="WHERE">LAST</field>
                    <value name="VALUE">
                      <block type="ohlc" id="2RhT}HYp{{{UXt7:|NP7">
                        <field name="CANDLEINTERVAL_LIST">default</field>
                      </block>
                    </value>
                  </block>
                </value>
              </block>
            </value>
            <value name="B">
              <block type="logic_boolean" id="IofUld~#iPE85!,Iq+k/">
                <field name="BOOL">FALSE</field>
              </block>
            </value>
          </block>
        </value>
        <statement name="DO0">
          <block type="purchase" id="nS}MJDv4}c3?vF^9Dy}@">
            <field name="PURCHASE_LIST">CALL</field>
          </block>
        </statement>
        <value name="IF1">
          <block type="is_candle_black" id="g%[`PTkL1:@`ozbkC,]X">
            <value name="OHLCOBJ">
              <block type="lists_getIndex" id="i,o;rH%)2c=(%$n}Xs]7">
                <mutation statement="false" at="false"></mutation>
                <field name="MODE">GET</field>
                <field name="WHERE">LAST</field>
                <value name="VALUE">
                  <block type="ohlc" id="Sc?++-Stm@SMC`nc,Ty}">
                    <field name="CANDLEINTERVAL_LIST">default</field>
                  </block>
                </value>
              </block>
            </value>
          </block>
        </value>
        <statement name="DO1">
          <block type="purchase" id="jwE^Bt)Xz$9x-t4U@p??">
            <field name="PURCHASE_LIST">PUT</field>
          </block>
        </statement>
      </block>
    </statement>
  </block>
  <block type="after_purchase" id="D^Jz1^n=2vtZku1vBN@;" x="0" y="673">
    <statement name="AFTERPURCHASE_STACK">
      <block type="procedures_callnoreturn" id=")ey_jft*{BD^pS|HSr^y">
        <mutation name="exMachina::Martingale (4)">
          <arg name="_profit(contract detail: profit)"></arg>
        </mutation>
        <value name="ARG0">
          <block type="read_details" id="eOd.NPkFO1,1Ay8SAOlc">
            <field name="DETAIL_INDEX">4</field>
          </block>
        </value>
        <next>
          <block type="controls_if" id="~6Ft46jqh*NpUOLS;:hL">
            <value name="IF0">
              <block type="procedures_callreturn" id="+LkDqKiy)ozUQ/DRLs^D">
                <mutation name="exMachina::TradeAgain"></mutation>
              </block>
            </value>
            <statement name="DO0">
              <block type="trade_again" id="c)S|KjoQdXc8l#J@5z3P"></block>
            </statement>
          </block>
        </next>
      </block>
    </statement>
  </block>
</xml>