Reply

Market/Day is either UP(green) or Down(red)

4 replies

ryanbrignac9764

Subscriber, bbp_participant, community, 89 replies.

Visit profile

9 years ago #113234

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?

0

ryanbrignac9764

Subscriber, bbp_participant, community, 89 replies.

Visit profile

9 years ago #128712

Has anyone figured this out or know the answer?

0

Mark Fric

Administrator, sq-ultimate, 2 replies.

Visit profile

9 years ago #128733

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

0

ryanbrignac9764

Subscriber, bbp_participant, community, 89 replies.

Visit profile

9 years ago #128741

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.

0

Mark Fric

Administrator, sq-ultimate, 2 replies.

Visit profile

9 years ago #128819

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

0

Viewing 4 replies - 1 through 4 (of 4 total)