PureBytes Links
Trading Reference Links
|
Tan, step changes are dependant on the data's change as well as the
step size used. Post a simple example of the data you are quantizing
and I'll understand better what you are trying to do.
For example, if yesterday's value is 25.5 and today is 26.4, using a
points step size of 1.0 will round step to the nearest integer, 26 for
both days. Using a points step size of 0.5 will plot 25.5 & 26.5.
===================
Stepped output test
===================
---8<--------------------------
{ Stepped Price/Indicator *test* output v2.0 }
{ ©Copyright 2005 Jose Silva
For personal use only
http://www.metastocktools.com }
{ User inputs }
x:=Input("Value to quantize",0,10000,26.4);
step:=Input("Step size",0,10000,0.5);
type:=Input("Step type: [1]$points, [2]%percentage",1,2,1);
{ Step size }
step:=Max(If(type=1,step,
LastValue(x*(step/100))),.00001);
{ Stepped data array }
stepX:=Int(x/step+.5)*step;
{ Plot on price chart or own window }
stepX
---8<--------------------------
jose '-)
http://www.metastocktools.com
--- In equismetastock@xxxxxxxxxxxxxxx, "tan ming"
<reminiscenostalgia@xxxx> wrote:
>
> Hi Jose, you step code works great when user can specify minimum
> change. I have a indicator which changes value (Small to big change)
> every day. I apply the step code to it and note that there r some
> days where there is no "step up or down" despite change in indicator
> value. I input a very small change in the input parameter. Is it
> possible to code so that the indicator will "step everyday" with new
> change in value?
------------------------ Yahoo! Groups Sponsor --------------------~-->
Try Online Currency Trading with GFT. Free 50K Demo. Trade
24 Hours. Commission-Free.
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/BefplB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/equismetastock/
<*> To unsubscribe from this group, send an email to:
equismetastock-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|