# Compare Ask price with a given previous price value - Unexpected result.

10

Hi,

I wanted to create an ea to enter trade whenever the price gone either x pips above or below a given price value.

For example,

Chart - AUDUDS symbol, Timeframe :1Hr, 15pips to trigger trade.

Start  ea at 0.79084 price value, so A = 0.79084 + 15pips = 0.79234 (Open buy trade)

Then B = 0.79084 - 15pips = 0.78934 (Open sell trade).

A and B was calculate once the ea initialize.

The compare price code is as below:

}

if(Bid < B){

}

But when applied to chart, it triggers Buy trade eventho the High value for that bar is only 0.79220.

Moderator
10541

sniper_ea:

But when applied to chart, it triggers Buy trade eventho the High value for that bar is only 0.79220.

if high value for the bid is 0.79920

10

Keith Watford:

if high value for the bid is 0.79920

Does it means that the price low, opened, closed, high for each bar is based on the Bid?

Thanks.

Moderator
2293

sniper_ea:

Does it means that the price low, opened, closed, high for each bar is based on the Bid?

Thanks.

Yes, the charts are based on Bid prices.

You can turn on a line to show the current Ask price, but that is all.