Hi, In my strategy when I get into a position(for e.g long) then there is a stop order also placed. My exit is after specific number of bars (for e.g 10). Can somebody give me code example as to how to club this stop order and sell order after 'N' bars into one group. The specific code snippet is
// hold the buy signal for 9 bars Buy = ExRemSpan(Buy,9); // generate the sell signal at 10th bar Sell = Ref(Buy,-10) // Now when buy is 1 first time, I should place order with stop as // well as sell after specific time using GAT // but then after 10 bars I assume I will have to ignore Sell // but this is where it gets tricky // I can have a buy signal generated at the exit bar thats why I have // buy held upto 1 bar less than exit // if there is a buy signal generated at the exit signal then Sell // signal from previous buy should be ignored (in auto trading // the sell order would have been executed by this time) // the stop order should be modified to include a new price and then // exit order should be placed after 10 new bars I am new to amibroker. If there is anyone in this forum who can provide consultancy to write the auto trading code then please contact me urgently.
