Daily Risk Maximum

2 replies


Customer, bbp_participant, community, 382 replies.

Visit profile

8 years ago #111296

In my trading plan, I do not allow more than 5% loss per day.  If 5% loss has been reached, then I stop trading for the day.


I would like the EA to follow this same trading plan.  With the new features that Mark and team have added into the last release (great job by the way with the new features – it is hard to improve upon perfect, but you guys are really setting the bar higher), I can now do this.


So what I have done so far is:


One rule counts the number of orders today:


Next rule establishes the account balance at the start of the day:


Next rule calculates what is 4.5% of the beginning account balance:


The final rule compares the total losses taken this day + any open orders P/L to see if the total loss is less than the 4.5% amount.  If it is greater, then it will close all open orders:



But I want to add a custom Command that will stop the EA from taking anymore trades (pause the EA) until a certain hour the next day.  What custom command can I use here?  I googled it, but did not find much help.


Thanks for your advice!





Customer, bbp_participant, community, 73 replies.

Visit profile

8 years ago #122044

I love this Stearno, did you ever get an answer?



Customer, bbp_participant, community, 382 replies.

Visit profile

8 years ago #122049

No, but I think I figured it out.  3 additions to the above:


1. I will have the last rule in the THEN part Close all the Orders (as seen in the picture) and also have another THEN condition that will set the value of the “No trade” variable to 1.

2. Then all entry rules, add a condition in the IF section that states trade if No Trade variable (does not) 1

3. Finally, add a new rule that says:


* No Trade variable = 1

* Hour[0] = 1


* Change “No Trade” variable value of No Trade to = 0


That way, then entry rules will not trade if the No Trade Variable = 1.  And then at a certain time (maybe 1 am or 7 am GMT (right before London, for example) I will have the rule change the No Trade variable back to 0.  This means the entry rules will now be open to take the next available trade.


This is what I came up with last night as falling asleep.  I attached an example in SQW file.  I have not tested it yet, but this was my idea.  Let me know of the results if you get a chance to test it.




Viewing 3 posts - 1 through 3 (of 3 total)