Closing price in Live different from backtesting

 

Hi,

I work now with dark venus with several weeks, and most of the time it's working well. But sometimes, I have an exit on live for some trades that should'nt happen, and when I backtest the same trades, It not closing where the live is closing. I'm on MT5. Please check the two images below that just happened yesterday, and I have several cases/day.  


1. Live (not closing right (first red arrow), losses)

NZDJPY - Live


2. Backtest (Closing right (first red arrow), profits)

NZDJPY - Backtest

 

I suspect the reason is the code. Debug it and or print out all the values and checks that cause the next closures.

 
Carl Schreiber #:

I suspect the reason is the code. Debug it and or print out all the values and checks that cause the next closures.

Thanks you Carl. I never did that. How to proceed to debug and to print out values and checks? 
 
I see something strange. On both charts closure happens exactly at the high of candle. Is it a lucky run or there is something about the choice of modelling? Choice of one minute OHLC could cause such optimistic backtests. 
 
Yashar Seyyedin #:
I see something strange. On both charts closure happens exactly at the high of candle. Is it a lucky run or there is something about the choice of modelling? Choice of one minute OHLC could cause such optimistic backtests. 

Thanks you for your reply. I've check and it's not always the case.  The backtest is done with "every tick based an real ticks"

 
akrilik #:

Thanks you for your reply. I've check and it's not always the case.  The backtest is done with "every tick based an real ticks"

OK. You should post your code in here so maybe someone will be interested to help you solve the issue. But you should notice that posting AI generated code in this forum is not a good practice.

 
Yashar Seyyedin #:

OK. You should post your code in here so maybe someone will be interested to help you solve the issue. But you should notice that posting AI generated code in this forum is not a good practice.

Unfortunately I don't have the code, it's the Dark Venus EA. It's free, but they are not sharing the code.