Hello,
i have a problem in the Strategy-Builder/Backtesttool of WL.
My WL is WL-Developer 6.9.15,
My OS is Win10 (64bit).
Here are the facts:
While backtesting, Long-Postition(s) is/are opened randomly and get never closed (like buy & hold).
It happens in the single open position mode but further Long-Positions are opened after such an error position is still open.
No compiler message, no alert or message in the debug log due to this problem.
It appers in every new strategy, doesn´t matter if in Strategy-Builder or as code version.
The same problem with already functionating code which is saved under a new name.
I tried to close the positions with „Current open position is older than a number of bars“ and „Active open position is older than a number of bars“ - makes no difference.
In one code (not in more) the problem was gone when i changed in the entry line the [bar+1] to [bar].
I don´t know if it is important but one day before the problem occured the first time, i installed the extension “Performance Visualizer” but on that day when i installed this extension (and restarted WL) i had no error.
By the way, i´ve tried a combination of the entry of a single open position code and the exits of a multi open position code to try to be able to close all open positions – than I had a complete multi open position strategy, even if the entry condition was “if (IsLastPositionActive == false)” multi positions were opened.
Please find in the attachment a strategy code (which i kept as simple as possible) in .txt format were the error occurs (this is the single open position version).
I also attached the trade list from the code example.
Has anybody a solution or an idea how to fix this problem?
CODE:
Please log in to see this code.