View Single Post
  #42 (permalink)  
Old 06-26-2007, 07:49 PM
Neo Neo is offline
Junior Member
 
Join Date: Jun 2006
Posts: 25
Neo is on a distinguished road
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
Reply With Quote