Not logged in
Viewing 5 posts - 1 through 5 (of 5 total)

Forums>AlgoWizard / EA Wizard>Application Support>Market/Day is either UP(green) or Down(red)

  • #113234 |
    Participant
    81 Posts

    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?

    #128712
    Participant
    81 Posts

    Has anyone figured this out or know the answer?

    #128733
    Mark Fric
    Administrator
    1182 Posts

    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).

    Mark
    StrategyQuant architect

    #128741
    Participant
    81 Posts

    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.

    #128819
    Mark Fric
    Administrator
    1182 Posts

    I’m still not sure I got it, but you can use OpenD(0) – this will return open of daily candle of the most recent day.

     

    To compare if actual price is above or below this open you can use comparison like:

     

    Ask > OpenD(0)

    Mark
    StrategyQuant architect

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

You must be logged in to reply to this topic.