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

Notification

Icon
Error

Options
Go to last post Go to first unread
disi  
#1 Posted : Monday, September 5, 2011 4:39:27 PM(UTC)
disi

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 9/5/2011(UTC)
Posts: 5

Hello guys.
I am looking for some 'old' MetaStock indicator - kind of Trailing Stop. I have it's code written for VTT forex platform, which is using most of metastock language(with small differences). Now I need original code for MetaStock, which was source for it's VTT versions back ago(it was written for VT based on MS version which I can not find now). VT code goes as follows:

_Pips:= Pips*SymbolPoint();
DeltaStop:= if(Mode=0,Wilders(ATR(atrperiods),atrsmperiods)*atrmult,_Pips);

TSL:= if(BarCount()>(atrperiods+atrsmperiods),
if(ref(price,-1)>PREV(0) AND price>PREV(0),max(PREV(0),price-DeltaStop),
if(ref(price,-1)<PREV(0) AND price<PREV(0),min(PREV(0),price+DeltaStop),
if(Cross(price,PREV(0)),price-DeltaStop,
if(Cross(PREV(0),price),price+DeltaStop,
if(price=PREV(0),PREV(0),PREV(0)))))),
NULL);


Anyone remembers Trailing Stop for MetaSTock with similar logic? Or maybe you can make it work with MS?
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.