I want to set condition when moving average crossed UP. enter Buy with 20 point above current price.
and it should not enter if current price is more than 100 Point above Crossed Price.
for example: for Gold
FastMa crossed SlowMA at $1250.
Entre buy at 1250.20 but does not enter if the price was $1251 . (+100)
so the range should be between 1250.20 to 1251.
is this correct code?
int PipMinDifference;
int PipMaxDifference;
double CurrentPrice;
if(FastMa > TrendMa + PipMinDifference * Point )
CurrentPrice = iClose(NULL,0,0)+PipMindifference; // Take current close price if(FastMa<=CurrentPrice+PipMaxDifference) // check if current price is below MaximumPipDifference Ex $1251
Order = SIGNAL_BUY;
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
I want to set condition when moving average crossed UP. enter Buy with 20 point above current price.
and it should not enter if current price is more than 100 Point above Crossed Price.
for example: for Gold
FastMa crossed SlowMA at $1250.
Entre buy at 1250.20 but does not enter if the price was $1251 . (+100)
so the range should be between 1250.20 to 1251.
is this correct code?