Hope someone has ran into this problem and may be able to help me out.
I have a simple strategy that I can either set it to short a position or go long a position based on some parameters I set.
But I want to know how would I create in the same EA to tell it to go long a position while the market is UP for the day or if it goes below market open price and now is DOWN for the day to short a position based on parameters?
I have tried multiple ways but can’t figure out how to set it knowing if market is currently up or down? I played with market position but from my understanding flat = no position currently, long = current position long, and short = current position is short.
I just want the EA to go long if market is up or go short is market is down with no current positions until the EA triggers?
sorry, I don’t understand what you want. What do you mean by market is up or down?
Does it mean that the market was growing during the current day?
You can use OpenD(0) to get the daily open and Ask or Bid to get current price and from there you know if the market was rising or not (if Ask > OpenD then it was rising).
No that didn’t answer my question but it does help me with another strategy I am working on.
I mean that at every day at 4pm my time (Central/USA) I get a new daily candle for the new day. What I am wording for example:
If USD/CAD, opened up with the new daily candle at 118.15,
How do I tell it that if that pair is up for the day meaning anything above 118.15 the strategies are to go long,
But if a its anything below 118.15 to short the strategies I have created.
Did this clarify it any?
I just didn’t know that if an EA can know if the pair is up or down for the day and then that will determine which strategy to use.
You must be logged in to reply to this topic.