I swear I had this working now today it is not. I am trying to have my script trade only if it has not exceeded a daily allowable loss for that day. Below is what I wrote to achieve this. MaxDailyLoss is an input value and YNP is defined as a variable.
This works once a MaxDailyLoss is exceeded but then never starts trading again on the next day.
Code: Select all
IF Date <> Date[1]
Then
YNP = NetProfit;
IF NetProfit - YNP >= MaxDailyLoss
Then Begin
( enter buy and sell short logic )
End;
I would imagine I am missing something really simple here but like I said it was working for me before now seems to no longer work. Before it would shut down for the day then start back up on the next trading day. Thanks for any help.