I have a Problem I can't overcome, but first let me make clear that everything is working perfectly fine as long "Exit on Session Close" is activated. Its also how my Strategy was built as I didn't have intention to keep the contracts overnight/weekend. However, I'm looking to include a Performance Metric, and so I needed to keep the trades open, and I deactivated the "Exit on Session close".
Now to the Problem, if I let the Analyzer run it will not use the whole time range (1 April to today) but stop mostly in the first 2-3 Months. First it looked like there would be a problem with the rollover, but I can move the Date forward to any Date, and it will have the same behavior to stop at a Random Spot. As you can guess I thought first I have a problem in my Script and turned on my debugging output and I was very surprised to see that, if I click in the analyzer one series after another, in the Output there is everything as it should be! It shows that there is being traded after the last Trade the Analyzer shows/calculates.
In my Strategy I work a lot with "Position.MarketPosition == MarketPosition.Flat", also in my Buy/Sell Logic function to prevent to be recalled if the Trade is already open.
I started to deactivate everything, in my entry logic, so that in the end there was just something like "if MA up" go long and "if MA down" go short and if "Position.MarketPosition == MarketPosition.Flat", even I thought I'm crazy I commented out this last line and there you go, it calculates all trades in the Analyzer as with "Exit on Session close".
I tried to make my own "intrade" variable with OnExecutionUpdate, as I was in hope it maybe uses a other logic but of course this is not any help. I also can't imagine what could prevent the
Analyzer to do the Job as it should, then with "Exit on Session close".it works fine with Trades going up to 2000-3000 Trades a Series. And from other side i can't work without "Position.MarketPosition == MarketPosition.Flat"as it messes up my logic in other functions and also from a performance point of view. Or is there something else to use?
Any Ideas?
Nemnem
Comment