Trying to understand "Lookback" and == in simple words

 

Hello everyone, hope someone might help me to understand the meaning of "Lookback" and ==

I was looking at an example in the code base and this newbie is not familiar with these basics yet

In this example:

if(Close[i]>iMA(Symbol(),0,Lookback,0,MODE_SMA,PRICE_HIGH,i+1))

If the Lookback value was specified as 5

Does this mean you you compare the current Close[i] to the value of iMA(.....) for all of the 5 previous values of iMA(...) before the if condition is satisfied

Also when two equals signs are used in succession Hlv ==-1

I am not sure if this means greater than or equal or something else

Thanks in advance for helping with these simple questions

 
pullend:

Hello everyone, hope someone might help me to understand the meaning of "Lookback" and ==

I was looking at an example in the code base and this newbie is not familiar with these basics yet

In this example:

if(Close[i]>iMA(Symbol(),0,Lookback,0,MODE_SMA,PRICE_HIGH,i+1))

If the Lookback value was specified as 5

Does this mean you you compare the current Close[i] to the value of iMA(.....) for all of the 5 previous values of iMA(...) before the if condition is satisfied

Also when two equals signs are used in succession Hlv ==-1

I am not sure if this means greater than or equal or something else

Thanks in advance for helping with these simple questions

'==' means 'equal with', see Operation of relation (MetaEditor > Navigator Window Ctrl + D > Basic > Operation & Expression > Operation of Relation)

Lookback in your iMA is a number of data for calculation (see iMA) better known as 'period'. If period (or lookback) is 5, it means the iMA takes data from 5 bars for calculation, NOT all of 5 previous values of iMA (MetaEditor > Navigator Window Ctrl + D > Technical Indicator > iMA() - Moving Average)

Reason: