[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CLOSE when Volume Limit Reached



PureBytes Links

Trading Reference Links

Taylan

> about a week ago I sent following mail but I couldn't get any answer if
any one of can help me I'll be glad.
>
> I wanted to create an indicator ( actually i want to redraw the chart )
which will show the closing values, only when cumulative volume
> reaches to certain value. ( each time cum(V) reaches to a value it will be
reset ) I'd tried by using PREV function but I couldn't manage.

This might get you started. Set 'limit' to whatever threshold you want and
each time the limit value is reached 'total' will reset to zero. The last
line just gives the CLOSE for the first bar or when 'total' is reset to
zero. Really weird how PREV won't seem to work with Cum().

limit:=10000000;
total:=Add(V,PREV) - If((V+PREV)>=limit,V+PREV,0);
ValueWhen(1,Cum(1)=1 OR total=0,CLOSE);

Roy