I have been trying to code something. I was trying to write a strategy which allows me to establish a few ways to exit after I establish a position. For example, I like to buy 20 contracts when the ES crossed above its 200-bar EMA and place a limit sell order to sell 10 contracts after it moves up by 3 points and sell the remaining 10 contracts when ES crosses below its 200-bar EMA. I tried to divide the entry into 2 parts like:
Code: Select all
Buy ("EMALE1") at next bar at Xaverage(C,200) limit;
Buy ("EMALE2") at next bar at Xaverage(C,200) limit;
Sell ("EMALX1") from entry ("EMALE1") at next bar at entryprice+3 limit;
Sell ("EMALX1") from entry ("EMALE1") at next bar at Xaverage(C,200) stop;