sellside flatbefore = 070000 flatafter = 173000 cumulateorders = false myatr = AverageTrueRange[14](close) myprice = close*0.0025 upperband = Average[100](close) + myprice myma = Average[100](close) myema = Average[50](close) possize = 1 barssincelasttrade = abs(TRADEINDEX(1) - BarIndex) if high[1] >= upperband and shortok = 0 then shortok = 1 endif if shortok = 1 and low[1] <= myma then shortok = 0 endif if time < 145500 and countofshortshares = 0 and shortok = 0 and barssincelasttrade > 2 and myema < myma and myatr < 10 then sellshort possize contracts at upperband - 1 limit endif if countofshortshares = 1 then exitshort at myma limit endif SET STOP LOSS 20 buy side defparam flatbefore = 070000 defparam flatafter = 173000 defparam cumulateorders = false myema = Average[50](close) myprice = close*0.0025 myatr = AverageTrueRange[14](close) barssincelasttrade = abs(TRADEINDEX(1) - BarIndex) //upperband = Average[100](close) + 20 lowerband = Average[100](close) - myprice myma = Average[100](close) possize = 1 if longok = 1 and high[1] >= myma then longok = 0 endif if time < 150000 and countoflongshares = 0 and longok = 0 and barssincelasttrade > 2 and myema < myma and myatr > 4 then buy possize contracts at lowerband + 1 limit endif if low[1] <= lowerband then longok = 1 endif if countoflongshares = 1 then sell possize contracts at myma limit endif SET STOP LOSS 20