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?
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;