stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

How to have EA look at past 10 bars for signal?
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=939
Page 1 of 1
Author:  jayjonbeach [ Wed Nov 07, 2012 2:19 am ]
Post subject:  How to have EA look at past 10 bars for signal?

Hi all. Looking for quick help to write a line of code for a signal.

I am using Step_Indy and an EMA cross for a combined signal. What I want to do is have the EA enter a trade only when both give a signal within 10 bars of each other.

So say that the Step gives a signal, I want the EA to look back 10 bars to see if there was a MA cross, if yes enter, if not ignore signal. (Note I don't want it to just check and see if the MA cross current signal is long, I want it to have been a recent NEW signal like within 10 bars, this is critical to the strat)

I know I need to likely use the 'for' function, but an unsure of how exactly I should structure it.

TIA for any help, I don't think I have seen this done in the past in any EA's I've looked at.
Author:  Solarwind [ Sat Nov 17, 2012 6:44 am ]
Post subject:  Re: How to have EA look at past 10 bars for signal?

I've used this..
for (int ct=SignalCandle;ct<=SignalCandle+LookBack;ct++) {

Hope it helps
All times are UTC Page 1 of 1