-
if(OrderSelect(ticket,SELECT_BY_POS))
A ticket number is not a position. -
double candleSlow = iMA(NULL,0,slowMaPeriod,slowMaShift,slowMaMethod,slowMaAppliedTo,candleNum); double candleFast = iMA(NULL,0,fastMaPeriod,fastMaShift,fastMaMethod,fastMaAppliedTo,candleNum); //Loop to look at the moving averages and make sure they have not crossed in the resont history. while(candleSlow<candleFast&&candleNum<candleRange-1) candleNum = candleNum++;
Your variables are constant in the loop.
out where the code is stopping and I have highlighted the code where I cant get it to move past. I run other bots I have made on the same tester with the same settings and they work fine but this one is just freezing up my tester. What am I missing? If the program continued I would expect the next print out to be "This is the else statement of the sell breakout function telling us its false." Highlighted
in blue but Its not getting that far.
The problem seems to be in "sellFractal()":
//Loop to look at the moving averages and make sure they have not crossed in the resont history. while(candleSlow>candleFast&&candleNum<candleRange-1) candleNum = candleNum++;
The values of "candleSlow" and "candleFast" will never change or update because they are only set once outside of loop and nothing in the loop cause them to update.
The loop in fact is just incrementing "candleNum", theoretically, because its not actually changing. You are post incrementing it but assigning the previous value, so it will just stay at 0 always.
Use one of the following but not both:
candleNum = candleNum + 1; // Either this ... candleNum++; // ... or this

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I am working on a new idea and for some reason I cant see why the back tester is just stopping. Its got to be something simple I'm missing. I have set up many print statements to find
out where the code is stopping and I have highlighted the code where I cant get it to move past. I run other bots I have made on the same tester with the same settings and they work fine but this one is just freezing up my tester. What am I missing? If the program continued I would expect the next print out to be "This is the else statement of the sell breakout function telling us its false." Highlighted
in blue but Its not getting that far.