Posted By: DonDiego
Compare indicator value to the highest value n bars ago - 03/06/23 18:26
Hi
I do want to compare the current value of a MovingAverage to a the highest value within the last 9 bars, excluding the current one, as a condition in an IF-statement.
something like if MA > Highest(MA,9)[1] then do this and that
I've found HH() but seems only to be useable for priceData and not an indicator.
MaxVal() expect to use series. So I did try:
but that throws an error (pointer expected).
I probably could find out what I need with a loop, but that seems to be an overkill and somehow inefficient for my little task.
I do want to compare the current value of a MovingAverage to a the highest value within the last 9 bars, excluding the current one, as a condition in an IF-statement.
something like if MA > Highest(MA,9)[1] then do this and that
I've found HH() but seems only to be useable for priceData and not an indicator.
MaxVal() expect to use series. So I did try:
Code
if(MA>MaxVal(MA[1],9)
but that throws an error (pointer expected).
I probably could find out what I need with a loop, but that seems to be an overkill and somehow inefficient for my little task.