Currently it says, "Determine the high and the low between 2:00 AM & 9:00 AM CET. If, after 9:00 AM the price breaks above that range, buy, if it breaks below that range then sell. Exit at a profit if the price continues an equal distance of that range. Exit at a loss if the price reverses to the other side of the range."
An executed trade can be in play for several days.
I have created a couple of workarounds in order to deal with the order handling rules but I am finding that there still needs to be a bit more improvement. So here it what I have in mind and need your help in figuring out how to adjust the way that my Exit Stop & Exit Limit orders are handled.
Currently the IOrder name for a trade that goes Long is "BreakoutLong". I would like to now have multiple iOrders and call them BreakoutLong1, BreakoutLong2, BreakoutLong3, etc.
Then my code would look something like this:
if (BreakoutLong1 == null && "other criteria - including the day's range") { EnterLongStop("BreakoutLong1"); ExitLongStop("BreakoutLong1"); ExitLongLimit("BreakoutLong1"); } else if (BreakoutLong1 != null && BreakoutLong2 == null && "other criteria - including the day's range") { EnterLongStop("BreakoutLong2"); ExitLongStop("BreakoutLong2"); ExitLongLimit("BreakoutLong2"); } else if (BreakoutLong1 != null && BreakoutLong2 != null && BreakoutLong3 == null && "other criteria - including the day's range") { etc etc etc }
Now to the point of the question, which deals with the Stop & the Limit orders. They are calculated from the range that is mentioned earlier and they are calculated from the range that is associated with the DAY that the order was executed.
Naturally, every single day there will be a new range that is formed so I need to know how to insure that the Stop & the Limit orders will remain the same despite the range changing as new days come and go. The Stop & Limit orders of each separate category (Breakout1, Breakout2, Breakout3) must remain the same until one of them is hit and then the other is cancelled automatically.
Thank you for your help and let me know if you need any additional information or clarification.
Comment