How to stop one strategy while another is in a running order

All posts which do not fit into any other sections of the forum.

Moderator: admin

How to stop one strategy while another is in a running order

Postby daniel.herrera » Sun Nov 13, 2016 3:36 am

I have a problem.

When the conditions for a strategy are fulfilled and an order is opened I do not want it to run again if the conditions are given until the open order ends.

My problem is that the strategy opens an order and if they re-enforce the conditions continues to open orders and that makes the risk management penalize me.

I do not know if by writing to an external file of some variable and that while that variable has a value the strategy can not open a new order. I do not know how to write the code for it.

Thank you for your help.
daniel.herrera
 
Posts: 6
Joined: Thu Nov 03, 2016 2:17 pm

Re: How to stop one strategy while another is in a running o

Postby Apprentice » Sun Nov 13, 2016 5:25 am

Check my End of Turn_Live Execution Strategy Template.lua
viewtopic.php?f=28&t=2712
Here I use LastEntry variable.

Ultimate solution is always.
public method host:execute("stop");
Brief
Stops the strategy which executed the command

To give an answer, I would have to know your complete trading idea.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36437
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: How to stop one strategy while another is in a running o

Postby Bradwell » Mon Jan 23, 2017 6:41 am

I believe that the evaluation should start even before we get the first simulation results. I mean, we need to make sure that the logic behind the strategy is sound and that it has a good chance of holding up in the future. Then we also need to make sure our historical data is complete and clean. You know, the results won’t matter if we start with shaky logic and bad data. After these initial steps, and still before we even start coding our strategy, we need to focus on real-time data and execution details. Here we need to make sure that it is possible to get the data we need, when we need it, and that it is possible to reasonably execute the trades as soon as we get our signals.
automated copy trading - http://www.mydigitrade.com/
Bradwell
 
Posts: 2
Joined: Fri Jan 20, 2017 9:10 am


Return to General Discussions

Who is online

Users browsing this forum: No registered users and 12 guests