I'm working with an EA that is set up to trigger only when the 4 hr & Day bars meet the required criteria. I want to include the 15 minute bar also but it is creating other issues.
To allow a trend to gather steam it is also set up to only check for trades when a new bar begins. ... that's where the issue lies.
I would like to control the EA so that it ONLY looks for trades with a new 4 hour bar. When I included the 15 minute condition for entry it checked the entry criteria when a 15 minute bar opened up. This flat didn't work.
Sample parts of the EA are included below ... your thoughts, coding threads etc are all welcome.
Thanks.
------------------------------------------------
if (NewBar())
{// if a new bar has opened
// check condition to open trade
int TradeDirection=0;
if ((ADXC15>ADXthreshold && ADXDIPC15-ADXDIMC15>DIthreshold) &&
(ADXC240>ADXthreshold && ADXDIPC240-ADXDIMC240>DIthreshold) &&
(ADXCst>ADXthreshold && ADXDIPCst-ADXDIMCst>DIthreshold)) TradeDirection=1;// long
}// end new bar
----------------------------------
The code is kinda paraphrased but I've tried to capture the key part of this. In summary , would very much like to include the 15 minute as a part of the analysis but to ONLY do so when the 4 hour bar begins.
To allow a trend to gather steam it is also set up to only check for trades when a new bar begins. ... that's where the issue lies.
I would like to control the EA so that it ONLY looks for trades with a new 4 hour bar. When I included the 15 minute condition for entry it checked the entry criteria when a 15 minute bar opened up. This flat didn't work.
Sample parts of the EA are included below ... your thoughts, coding threads etc are all welcome.
Thanks.
------------------------------------------------
if (NewBar())
{// if a new bar has opened
// check condition to open trade
int TradeDirection=0;
if ((ADXC15>ADXthreshold && ADXDIPC15-ADXDIMC15>DIthreshold) &&
(ADXC240>ADXthreshold && ADXDIPC240-ADXDIMC240>DIthreshold) &&
(ADXCst>ADXthreshold && ADXDIPCst-ADXDIMCst>DIthreshold)) TradeDirection=1;// long
}// end new bar
----------------------------------
The code is kinda paraphrased but I've tried to capture the key part of this. In summary , would very much like to include the 15 minute as a part of the analysis but to ONLY do so when the 4 hour bar begins.