Rank: Advanced Member
Groups: Registered, Registered Users Joined: 9/26/2005(UTC) Posts: 185 Location: Brazil
|
Hi Henry and forum friends,
Nice indicator you have there:
http://forum.equis.com/v...hp?t=423&highlight=renko
I was working on automating the K value to be equal to the default done by Metastock, instead of doing it manually for each graph as I also needed to include the value in an Expert Advisor.
I reached the following result that I would like to share:
RenkoBoxSize Indicator:
VarI:=Cum(1);
VarII:=((HHV(H,LastValue(VarI-PREV+PREV)) - LLV(L,LastValue(VarI-PREV+PREV))) / 25);
VarII
Then in your code I would change the fixed K value like this:
K:= LastValue( Fml( "RenkBoxSize") ) ;
RenkoLine:=If(Cum(1)=1,CLOSE,
If(PREV>=0,
If(CLOSE<PREV-2*K,-(PREV-2*K),
Floor(Max(C-PREV,0)/K)*K+PREV),
If(CLOSE>Abs(PREV)+2*K,-PREV+2*K,
Floor(Max(Abs(PREV)-C,0)/K)*K+PREV)));
RL:=Abs(RenkoLine);
RL;
BW:=If(Cum(1)=1,0,
If(RL>Ref(RL,-1),+1,If(RL<Ref(RL,-1),-1,PREV)));
BW;0;
Thanks: goes to Henry for the Renko, and to Patrik for the usage of variables example.
Thanks,
Bulli ;)
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.