Price Action opening and closing above a MA

Created at 15 Jul 2022, 16:10
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
JE

jeremy.ayres

Joined 27.06.2019

Price Action opening and closing above a MA
15 Jul 2022, 16:10


When comparing moving average values on open and close how can I compare this against Price Action values? E,g,. if one is greater than the other, surely I would need to compare similar values, or there a built-in way to call this is in the code?


@jeremy.ayres
Replies

firemyst
23 Sep 2022, 06:50

RE:

jeremy.ayres said:

When comparing moving average values on open and close how can I compare this against Price Action values? E,g,. if one is greater than the other, surely I would need to compare similar values, or there a built-in way to call this is in the code?

What price action values do you want to compare against? Open prices? Close prices?

You would just need to do something similar to:

MovingAverage1.Result.LastValue >= Bars.ClosePrices.LastValue

Not that in the current bar, the current price is always the "close price" even if the bar hasn't closed yet.


@firemyst