Would anyone know how to program a ‘WAIT’ into code in for automated trading. In other words, in auto trading I have code that says buy or sell when one MA crosses over another.
However when that happens I want to wait until my DEMA has changed direction as well.
Any idea how to write code to ‘wait’ for a number of indicators to happen over a 5 minuteperiod while in the 1 minute timeframe before buying or selling. Appreciate in advance any help
Just save the first condition in a variable and check for the second condition to be met during the next 5 bars. Is it met, you buy, if not you start the process again waiting for the first condition.
Thanks for that… Im new but getting the swing of it……
Hi
Did you ever get to see an example of how to implement this?
regards
James
When your condition is met, just look back n bars to detect any crossing.