Problems back-testing my bot

You probably did not calculate the SL/TP values correctly so the price never reached those levels.
Alon D  

My bot works with visual testing.

Just not with optimization.

Anyway, for buying this is my calculation:


   Bid = SymbolInfoDouble(_Symbol, SYMBOL_BID);  // Current Bid price.

   Ask = SymbolInfoDouble(_Symbol, SYMBOL_ASK);  // Current Ask price.

         TP = Ask + (TakeProfit_inPips * _Point);

         SL = Bid - (StopLoss_inPips * _Point);

For selling:

         TP = Bid - (TakeProfit_inPips * _Point);

         SL = Ask + (StopLoss_inPips * _Point);   

Pip is not the same as point. Without knowing the values no one can say exactly what is going on.
Alon D  
How would you suggest changing it?

Spend some time to learn about Pip, Point and Digits. Then check the Digits value of the symbol you want to trade and use it to calculate the right SL/TP value.

Profit to pips
Profit to pips
  • 2015.01.14
Hi, how can I convert order profit to pips? Asuming I know lotsize etc. I want to create trailing stop, but profit oriented. Thanks...
How do i get a refund for purchasing a bot that is unresponsive to my modifications and just do want it wants?