﻿<xml xmlns="http://www.w3.org/1999/xhtml">
  <block type="procedures_defreturn" id="K@K)7,y2h+Gy%C.vVU~w" x="0" y="0">
    <mutation>
      <arg name="Ticks List"></arg>
      <arg name="period"></arg>
    </mutation>
    <field name="NAME">Exponential Moving Average</field>
    <comment pinned="false" h="80" w="160">Describe this function...</comment>
    <statement name="STACK">
      <block type="procedures_ifreturn" id="n(uz.(qBLf`u[{|V@uxf">
        <mutation value="1"></mutation>
        <value name="CONDITION">
          <block type="logic_compare" id="OW0bc:1#0tXAxtnE;Cwf">
            <field name="OP">LTE</field>
            <value name="A">
              <block type="lists_length" id="Y1:9t#zMDea[@bUgNf+M">
                <value name="VALUE">
                  <block type="variables_get" id="@b{,h!y/7qizcms3RS8/">
                    <field name="VAR">ticks list</field>
                  </block>
                </value>
              </block>
            </value>
            <value name="B">
              <block type="variables_get" id="XcH}g?|v7S(A)]u_HAG_">
                <field name="VAR">period</field>
              </block>
            </value>
          </block>
        </value>
        <value name="VALUE">
          <block type="math_arithmetic" id="Tb]hOG`|={VaHSw}dqE[">
            <field name="OP">DIVIDE</field>
            <value name="A">
              <shadow type="math_number" id="U!FRqvo!K0B(ZUVwj~9y">
                <field name="NUM">1</field>
              </shadow>
              <block type="math_on_list" id="#BbwFbxu;V@vs|tBd05M">
                <mutation op="SUM"></mutation>
                <field name="OP">SUM</field>
                <value name="LIST">
                  <block type="variables_get" id="sA,[SGm5?}XfEIW{;#o6">
                    <field name="VAR">ticks list</field>
                  </block>
                </value>
              </block>
            </value>
            <value name="B">
              <shadow type="math_number" id="0g@UTMc=T,q/%(@uRLbB">
                <field name="NUM">1</field>
              </shadow>
              <block type="variables_get" id="}%mQeq,ueqO6J{n3HDm^">
                <field name="VAR">period</field>
              </block>
            </value>
          </block>
        </value>
        <next>
          <block type="variables_set" id="[e]YD]6K%um5U8ErY8MZ">
            <field name="VAR">Multiplier</field>
            <value name="VALUE">
              <block type="math_arithmetic" id="x`a|wuX{cZVXd@6%~{MC">
                <field name="OP">DIVIDE</field>
                <value name="A">
                  <shadow type="math_number" id="Kh6M*0;!_nj`3.#`3`h{">
                    <field name="NUM">2</field>
                  </shadow>
                </value>
                <value name="B">
                  <shadow type="math_number" id="N:vnu5=6zcT#Jny0jDJb">
                    <field name="NUM">1</field>
                  </shadow>
                  <block type="math_arithmetic" id="i}i/r{M!DhA%LZj~Zs/G">
                    <field name="OP">ADD</field>
                    <value name="A">
                      <shadow type="math_number" id="*PxhF0]#xn.o0LA%F`|)">
                        <field name="NUM">1</field>
                      </shadow>
                    </value>
                    <value name="B">
                      <shadow type="math_number" id="hXE{%ecgStdZ%f9Su~Wz">
                        <field name="NUM">1</field>
                      </shadow>
                      <block type="variables_get" id="*I[9PZ,eY}KSp@XIsQOq">
                        <field name="VAR">period</field>
                      </block>
                    </value>
                  </block>
                </value>
              </block>
            </value>
            <next>
              <block type="variables_set" id="z{pY3Ymc:t#c`1Im3=b#">
                <field name="VAR">Previous EMA</field>
                <value name="VALUE">
                  <block type="procedures_callreturn" id=".KA%G;aaB~zzGR-wF*T`">
                    <mutation name="Exponential Moving Average">
                      <arg name="Ticks List"></arg>
                      <arg name="period"></arg>
                    </mutation>
                    <value name="ARG0">
                      <block type="lists_getSublist" id="?(G4HGrv6.9U`-LB#9h.">
                        <mutation at1="false" at2="true"></mutation>
                        <field name="WHERE1">FIRST</field>
                        <field name="WHERE2">FROM_END</field>
                        <value name="LIST">
                          <block type="variables_get" id="O?F,CMEnuBt(V(({dGBs">
                            <field name="VAR">ticks list</field>
                          </block>
                        </value>
                        <value name="AT2">
                          <block type="math_number" id="pMG)qu+foYoOM#J9Lq`G">
                            <field name="NUM">2</field>
                          </block>
                        </value>
                      </block>
                    </value>
                    <value name="ARG1">
                      <block type="variables_get" id="/J8a=#w#EH[I1[a[|skB">
                        <field name="VAR">period</field>
                      </block>
                    </value>
                  </block>
                </value>
              </block>
            </next>
          </block>
        </next>
      </block>
    </statement>
    <value name="RETURN">
      <block type="math_arithmetic" id="m:fhPW[Cu23.eVQ!cNy{">
        <field name="OP">ADD</field>
        <value name="A">
          <shadow type="math_number" id="9~.w5TLemkQ2KX{RjNJR">
            <field name="NUM">1</field>
          </shadow>
          <block type="math_arithmetic" id="SM~*:KWL-Q_tB_V]?(t-">
            <field name="OP">MULTIPLY</field>
            <value name="A">
              <shadow type="math_number" id="Wx29PtiwjMo{G%z8.k7E">
                <field name="NUM">1</field>
              </shadow>
              <block type="math_arithmetic" id="WlwKo[r2U5BXAN?[way2">
                <field name="OP">MINUS</field>
                <value name="A">
                  <shadow type="math_number" id="pG|6HT6|O~vSu_0,DAy7">
                    <field name="NUM">1</field>
                  </shadow>
                  <block type="lists_getIndex" id="=!P#m}?kMLg*|GS+y[lo">
                    <mutation statement="false" at="false"></mutation>
                    <field name="MODE">GET</field>
                    <field name="WHERE">LAST</field>
                    <value name="VALUE">
                      <block type="variables_get" id="26=,N09U^h)7c3l`@NrC">
                        <field name="VAR">ticks list</field>
                      </block>
                    </value>
                  </block>
                </value>
                <value name="B">
                  <shadow type="math_number" id="c@]YpAl/e1PP[}aR]D]Y">
                    <field name="NUM">1</field>
                  </shadow>
                  <block type="variables_get" id="(7sqm~V-NI*.G:n)2l{}">
                    <field name="VAR">Previous EMA</field>
                  </block>
                </value>
              </block>
            </value>
            <value name="B">
              <shadow type="math_number" id="N6pofjlrzS^^M[DZKkE!">
                <field name="NUM">1</field>
              </shadow>
              <block type="variables_get" id="*{~4VL`%iIMdXn+=X6BX">
                <field name="VAR">Multiplier</field>
              </block>
            </value>
          </block>
        </value>
        <value name="B">
          <shadow type="math_number" id="eldA;R*1_.or?6avLd/F">
            <field name="NUM">1</field>
          </shadow>
          <block type="variables_get" id="+zS3ib?95@HKOIcS9QMx">
            <field name="VAR">Previous EMA</field>
          </block>
        </value>
      </block>
    </value>
  </block>
  <block type="trade" id="L({{BOb-KQ0_1jfH|7Zg" deletable="false" x="0" y="310">
    <statement name="SUBMARKET">
      <block type="frxaudjpy" id="tO;MJdJn]h.tF0ik,*kE">
        <statement name="CONDITION">
          <block type="risefall" id="U*M9uE!97xwem{1S!|~w">
            <field name="CANDLEINTERVAL_LIST">60</field>
            <field name="DURATIONTYPE_LIST">t</field>
            <field name="PAYOUTTYPE_LIST">stake</field>
            <field name="CURRENCY_LIST">USD</field>
            <value name="DURATION">
              <block type="math_number" id="%5@Z%YM5S(u*V[hx;,^h">
                <field name="NUM">5</field>
              </block>
            </value>
            <value name="AMOUNT">
              <block type="math_number" id="!qgqsw[J@!mZO4l85AFz">
                <field name="NUM">1</field>
              </block>
            </value>
          </block>
        </statement>
      </block>
    </statement>
  </block>
  <block type="on_strategy" id="nG`7zg_ax[1li#uaJG9b" deletable="false" x="0" y="589">
    <statement name="STRATEGY_STACK">
      <block type="controls_if" id="kK,fQ`J4P)8*8ai^r.)5">
        <mutation else="1"></mutation>
        <value name="IF0">
          <block type="logic_compare" id="f~q.cVYx%=)?C874?JB6">
            <field name="OP">GT</field>
            <value name="A">
              <block type="read_ohlc" id="b;raH{m:,@r:|9}1VEB)">
                <field name="OHLCFIELD_LIST">close</field>
              </block>
            </value>
            <value name="B">
              <block type="procedures_callreturn" id="3vt2hSCU;I?(]D`9qC!5">
                <mutation name="Exponential Moving Average">
                  <arg name="Ticks List"></arg>
                  <arg name="period"></arg>
                </mutation>
                <value name="ARG0">
                  <block type="ohlc_values" id="MQ{rZhgmn0YDJ3dXnU~(">
                    <field name="OHLCFIELD_LIST">close</field>
                  </block>
                </value>
                <value name="ARG1">
                  <block type="math_number" id="X5uPV=j^5uNK0*(ngfr*">
                    <field name="NUM">5</field>
                  </block>
                </value>
              </block>
            </value>
          </block>
        </value>
        <statement name="DO0">
          <block type="purchase" id="Ci:I+}NLgjP_a?zCu*QP">
            <field name="PURCHASE_LIST">CALL</field>
          </block>
        </statement>
        <statement name="ELSE">
          <block type="purchase" id="TJb^[a,YsySudU`]-@zy">
            <field name="PURCHASE_LIST">PUT</field>
          </block>
        </statement>
      </block>
    </statement>
  </block>
  <block type="during_purchase" id=".@/(FD_F7Al}ezM`e`n7" deletable="false" x="0" y="817"></block>
  <block type="on_finish" id="D;NptzlS4wIIOrKt|8b=" deletable="false" x="0" y="904">
    <statement name="FINISH_STACK">
      <block type="trade_again" id="SZ1+9`4Q8mX7qn))9qGB"></block>
    </statement>
  </block>
</xml>