I found this code (Attachments) in this thread (Daily loss limit examples - NinjaTrader Support Forum) and i modified it for my needs,
Basically, I have basic knowledge in programming and just wanted to make sure I did the right modifaication.
This Strategy needs to close active positions if the daily loss P/L reached to the stop limits.
Alternatively, it needs to stop me from placing a new positions when the P/L reached to the daily loss limit.
The changes I've made :
Line 38 : Calculation.OnBarClose ------> Calculation.OnEachTick.
Line 41 : LossLimit : 500 ------> LossLimit : 350
I'm not quite sure about the reset condition - Line 53 - "IsFirstBartOfSession" does it indicates on a new trading day ?
After I imported it and made the modifications for my needs and after I enabled it - it looks like it still doesn't work..
I have entered the right instruments - using Sim1 account in order to check it but it it doesn't seems to work..
Any idea ?
Thanks in advance .
Comment