@DdlV: Thanks, %i does it!

@Petra:
Quote:
Maybe, your script has a bug which makes it trade just randomly?
This won't explain IMO why it trades always in backtest and never in real trading.

@RTG: There are still several points of failure, the conditions could not become true, BuyStop, SellStop and/or the margins could not have been calculated or at last, Zorro refused to open trades. I added some lines of debug code that should reveal where to investigate further. If the script should trade each day, omit the "dow() == 5 &&" from the conditions, then the trade will be immediately closes afterwards (if it's not Friday) but this is not important for our purpose.

Attached Files
ONS_Sphin_DEBUG.txt (378 downloads)