Hello,
When I click Compile and Run the Strategy for the first time (using 1 contract on ES, RP mode, Futures mode enabled) WL shows me a Net Profit of $16174. But when I press F5 again on the chart (nothing has been changed), the Net Profit is now $20844.
Why is it so? On what number should I look. What am i missing?
Thanks in advance.
CODE:
Please log in to see this code.
Size:
Color:
Size:
Color:
Eugene, thanks.
But I run a strategy in Raw Profit mode on a single symbol, not in MSB mode. Do i still need to assign position priority?
Size:
Color:
No, in this particular case the error is caused by defining variables as class-level:
CODE:
Please log in to see this code.
Move the variable declarations (except the StrategyParameters which are at the right place) inside the Execute() method body and the Strategy should start working as expected.
Consider not using class-level variables unless they are really required by your Strategy's logic. Usually it's not the case with 95% Strategies.
Size:
Color:
Eugene, thank you. Now all works as expected.
Size:
Color: