i want to code an expression so that if it occurs in the last n bars do something
exampe:
Code: Select all
condition1=Momentum( Close, 34 )>30;
if condition1 or condition1[1] or condition1[2] or condition1[3] then do something;
Code: Select all
condition1=Momentum( Close, 34 )>30;
if condition1 or condition1[1] or condition1[2] or condition1[3] then do something;
Code: Select all
input:
Look.back(10);
var:
big.mom(0);
if Momentum( Close, 34 )>30 then
big.mom = 1
else
big.mom = 0;
if summation( big.mom, look.back ) > 0 then do something;
How much more native than a summation?Yes is correct, but I thought there was a native instruction to do this