|
Ok, Don...here's how to sort the trend filtering:
extern int MAPeriod = 1200;
double Trend = iMA(NULL, 0, MAPeriod, 0, MODE_LWMA, MODE_CLOSE, 0);
should be...
double Trend = iMA(NULL, PERIOD_M1, MAPeriod, 0, MODE_LWMA, MODE_CLOSE, 0);
as your existing code uses 1200 periods of the current chart timeframe
And for the Buy and Sell routines, you're missing some brackets so the logic is currently wrong so these:
if (Ask < LowestBuy-(Spacing*Point) || Ask > HighestBuy + (TrendSpacing * Point) && Ask > Trend)
if (Bid > HighestSell + (Spacing * Point) || Bid < LowestSell - (TrendSpacing * Point) && Bid < Trend)
should be replaced with:
if ((Ask < LowestBuy-(Spacing*Point) || Ask > HighestBuy + (TrendSpacing * Point)) && Ask > Trend)
if ((Bid > HighestSell + (Spacing * Point) || Bid < LowestSell - (TrendSpacing * Point)) && Bid < Trend)
Good luck, Neo
|