logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
henry1224  
#1 Posted : Wednesday, April 13, 2005 1:45:38 AM(UTC)
henry1224

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/29/2004(UTC)
Posts: 1,394
Location: Glastonbury, CT

Was thanked: 2 time(s) in 2 post(s)
Plot this Indicator in it's own window K:=1.896; 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;
wdgigi  
#2 Posted : Thursday, March 6, 2008 10:18:22 AM(UTC)
wdgigi

Rank: Member

Groups ready for retrieval: Registered, Registered Users
Joined: 3/6/2008(UTC)
Posts: 16

Goodmorning,

may someone translate this tradestation's code in metastock language?

Is a code for renko chart with adaptive atr by konkop:

{Renko-Adaptive indicator (based on ATR)
Written by konkop 07.03.2002.
*********************
Attention: set MaxBarsBack (f.e. =30) in this study according with
MaxBarsBack value in the Renko_Adaptive strategy
for correct step-by-step calculations of the buy/sell levels
*********************}

Inputs: K(1),
Smooth(10);

vars:Brick(0) ,DN(0), UP(0), BricksUp(0), BricksDn(0);

Value1 = AvgTrueRange(Smooth);

If BarNumber = 1 Then Begin
Up = H;
Dn = L;
Brick = K*(H - L);
End;
If BarNumber > 1 then begin
If C > UP + Brick Then begin
BricksUp = IFF(Brick = 0, 0, Floor((C - Up)/Brick)*Brick);
UP = Up + BricksUp;
Brick = K*Value1;
DN = Up - Brick;
BricksDn = 0;
End;
If C < Dn - Brick Then begin
BricksDn = IFF(Brick = 0, 0, Floor((Dn - C)/Brick)*Brick);
Dn = Dn - BricksDn;
Brick = K*Value1;
Up = Dn + Brick;
BricksUp = 0;
End;
End;

Plot1(UP, "Up");
Plot2(DN, "Dn");
{***************end of code****************}

thanks.

gigi

wdgigi  
#3 Posted : Wednesday, April 30, 2008 5:23:51 AM(UTC)
wdgigi

Rank: Member

Groups ready for retrieval: Registered, Registered Users
Joined: 3/6/2008(UTC)
Posts: 16

Lot of thanks.

wdgigi

wabbit  
#4 Posted : Wednesday, April 30, 2008 9:02:03 PM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
gigi,

Without spending too much looking at the problem, I will suggest this function cannot be implemented easily in the MS formula language as it contains loops and references to previously computed variables.

The best option for this code is to write it as an external function using the MDK.


wabbit [:D]

Mavirk  
#5 Posted : Friday, May 9, 2008 11:55:14 AM(UTC)
Mavirk

Rank: Newbie

Groups: Registered, Registered Users, Unverified Users
Joined: 8/2/2006(UTC)
Posts: 4

Hi Wabbit,

How about using PREV?
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.