Gurumeher Sawhney
Thank you for looking into my question. Let me use an example to better help illustrate what I'm looking for.
Let's say I'm interested in creating an algo that liquidates my holdings of "EURUSD" on the release of a major economic release. Five minutes later, once the trade direction is a little clearer, it will place an order. The economic releases are not consistent, so they could be at any time of day (which means most of the scheduled events for a time of day or date won't work. Also, I only want it to wait and implement the order once, so a recurring scheduled event won't work either.
The code would probably go through a loop, but I need to implement a waiting period so it can liquidate upon release and then run a second time to place the order after a predetermined waiting period.
Other issues I'm having with this code are:
- How to be sure it runs only once even if the Economic Calendar triggers two events at the same time.
- How to limit the trigger to events for currencies I'm trading. Right now the code will liquidate no matter what currency it is for.
I've attached a simple backtest to show how far I've gotten. Maybe it will help explain what I'm looking for or where I'm stuck at.