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

RE: [EquisMetaStock Group] Metastock Fixed Trailing Stop Loss



PureBytes Links

Trading Reference Links





A futher thank you 
for the assistance last week of Peter Kuskopf, Steve Roweau, and Roy Larsen for 
putting forward some great alternatives for fixed stops in the Enhanced System 
Tester.
<SPAN 
class=673253207-10082003> 
After getting my 
head around the code volunteered, I have found that your code, Roy, with the two 
PREV functions gives me what I want and does not seem to slow my machine too 
much when running through reasonably large databases ie
<SPAN 
class=673253207-10082003> 
A:=3; {ATR 
multiplier}BC:=Cross(Mov(C,15,E),Mov(C,25,E)); {buy 
example}SC:=Cross(Mov(C,25,E), Mov(C,15,E)); {sell example}<FONT 
color=#ff0000>Trade:=If(PREV<=0,BC,If( {SC OR} {optional 
sell}C<HighestSince(1,PREV=0,C)-A*ATR(7),-1,1));Trade<0;
<SPAN 
class=673253207-10082003> 
 I specifically 
wanted to hang the 3*ATR(7) stop from the highest high SINCE POSITION ENTRY and 
the code does this beautifully and verified with a chart indicator showing the 
code provided as a binary wave and also checking the results with alternate 
system testing software. It also works if you allow pyramiding 
of positions! It even makes money in this basic form!!
<SPAN 
class=673253207-10082003> 
Whilst I can follow 
the above code, I am just a little unclear what the rule "PREV<=0" is 
referring back to. I assume it is checking that the BC condition has not fired. 
If you could give some clarification here it would greatly increase my ability 
to use the PREV function in the future. I suspect other Metastock users in this 
Group may struggle with this very important function also.
<SPAN 
class=673253207-10082003> 
Once again thanks 
for the help. In the meantime, I shall be trying to incorporate multi-exit 
conditions into the above code such as if the Chandelier Exit fired or a fixed 
number of days has expired.
<SPAN 
class=673253207-10082003> 
<FONT face="Kunstler Script" color=#008000 
size=5>Regards,
<FONT face="Kunstler Script" color=#008000 
size=5> 
Gordon 
Sutherland

  
  <FONT 
  face=Tahoma size=2>-----Original Message-----From: Roy Larsen 
  [mailto:rlarsen@xxxxxxxxxxxxxx] Sent: Tuesday, 5 August 2003 11:34 
  a.m.To: equismetastock@xxxxxxxxxxxxxxxSubject: Re: 
  [EquisMetaStock Group] Metastock Fixed Trailing Stop Loss to go along with 
  Trade Sim?GordonI'm happy to give whatever 
  assistance you need to sort out the problem orexplain any code. You just 
  have to ask.Roy----- Original Message ----- From: 
  "Gordon Sutherland" <gosuth@xxxxxxxxxxxx>To: 
  <equismetastock@xxxxxxxxxxxxxxx>Sent: Tuesday, August 05, 2003 11:15 
  AMSubject: RE: [EquisMetaStock Group] Metastock Fixed Trailing Stop Loss 
  to goalong with Trade Sim?> Peter and Roy,>> 
  Thank you both for your great inputs. Not having a programmer's logic 
  I> do struggle with having to build code if the functions are not 
  available> in the application. So, when I receive help to find a 
  solution it is> like opening up Aladdin's cave!>> Roy, I 
  am tied-up for next day or so but I will get my head around the> two 
  methodologies and see if I can make it work for me and perhaps I can> 
  come back if I need clarification.>> Regards,>> 
  Gordon Sutherland>> -----Original Message-----> From: 
  Peter Kuskopf [mailto:pkuskopf@xxxxxxxxxxxxxxx]> Sent: Tuesday, 5 
  August 2003 10:18 a.m.> To: equismetastock@xxxxxxxxxxxxxxx> 
  Subject: Re: [EquisMetaStock Group] Metastock Fixed Trailing Stop Loss> 
  to go along with Trade Sim?>>> Also check Roy Larsen's 
  comments regarding use of a PREV latch. I don't> use the PREV latch 
  because of the speed issues, but it will depend on> the size of the 
  database, and your requirements for accuracy.>> Peter 
  K>> ----- Original Message ----- > From: Gordon  
  <mailto:gosuth@xxxxxxxxxxxx> Sutherland> To: 
  equismetastock@xxxxxxxxxxxxxxx> Sent: Tuesday, August 05, 2003 7:54 
  AM> Subject: RE: [EquisMetaStock Group] Metastock Fixed Trailing Stop 
  Loss> to go along with Trade Sim?>> 
  Peter,>> Thank you for you input - your code looks excellent - I 
  will try it out.> I must admit that I have not tried to use the code 
  Equis supplied as of> yet.>> Regards,>> 
  Gordon Sutherland>> -----Original Message-----> From: 
  Peter Kuskopf [mailto:pkuskopf@xxxxxxxxxxxxxxx]> Sent: Monday, 4 August 
  2003 9:47 p.m.> To: equismetastock@xxxxxxxxxxxxxxx> Subject: Re: 
  [EquisMetaStock Group] Metastock Fixed Trailing Stop Loss> to go along 
  with Trade Sim?>>> I think the formula that Equis gave 
  you will get you just the high of> the entry day.>> For a 
  trailing chandelier, that is, updated with each new high, you> probably 
  want:>> ARC=3; {for example}> BC={Buy Condition};> 
  C<=HighestSince(1, BC, H) - ARC*atr(7);>> 
  Peter>> ----- Original Message ----- > From: Gordon  
  <mailto:gosuth@xxxxxxxxxxxx> Sutherland> To: 
  equismetastock@xxxxxxxxxxxxxxx> Sent: Monday, August 04, 2003 5:30 
  PM> Subject: RE: [EquisMetaStock Group] Metastock Fixed Trailing Stop 
  Loss> to go along with Trade Sim?>> I wanted to to set a 
  Chandelier Exit in the Enhanced System Tester EOD> and received the 
  following assistance from Equis Inter'l. Metastock> seems to make it 
  very hard to establish easily the Position Entry Date.> Hope the 
  undermentioned doesn't add to the confusion.> Regards,> Gordon 
  Sutherland>> From: formulas@xxxxxxxxx> Sent: Thursday, 26 
  June 2003 3:54 a.m.> To: gosuth@xxxxxxxxxxxx> Subject: RE: 
  Coding of a Volatility Exit [T200306230076]>>> 
  Sir,>> you will have to use the valuewhen function.> It 
  would look like :>> BC:={buy condition};> 
  Valuewhen(1,BC,H)>> Hope this helps>> Best 
  regards,> Patrick S Nouvion> Equis Technical 
  support>> -----Original Message----- > From: 
  IMCOutgoing> Sent: Monday, June 23, 2003 3:09 AM> Subject: 
  Re:Coding of a Volatility Exit [T200306230076Z305061]>>> 
  Sender  : gosuth@xxxxxxxxxxxx> Tracking 
  Number         : 
  T200306230076Z305061> Pool    : Formulas> Sent 
  to         : Equis support 
  <support@xxxxxxxxx>> Date    : 6/23/2003 3:09 
  AM>   _____>> Forwarded by: 
  Doug>> (no comments entered)>   
  _____>> Hi,>>> I am running MetaStock 8.01 
  EOD. I would like to write a rule that will> trigger an exit in the 
  Enhanced System Tester if the Close falls below> say 3 *  ATR(7) 
  from the High since entry of the trade. I can't see a> Simulation 
  function that will give me the Position High Price. Is it> possible for 
  you to help me with this, I am hoping to use it in a TA> Society 
  presentation later this week and to provide the hard code rather> than 
  just the concept of a "Chandelier Exit" would add 
  credibility.>>> TIA.>> 
  Regards,>> Gordon Sutherland> New 
  Zealand>>>>> Regards,>> 
  Gordon Sutherland>> -----Original Message-----> From: 
  metastockuser [mailto:metastockuser@xxxxxxxxx]> Sent: Monday, 4 August 
  2003 5:29 p.m.> To: equismetastock@xxxxxxxxxxxxxxx> Subject: 
  [EquisMetaStock Group] Metastock Fixed Trailing Stop Loss to go> along 
  with Trade Sim?>>> Does anyone here know how to set up a 
  fixed trailing stop loss in a> metastock exploration (8.0 End of Day) 
  that will work with trade Sim?>> I've found a formula on the net 
  but not being a programmer don't> really understand it or how to work 
  it into a set up so that it works> with Trade Sim>> 
  If(cum(1)=1,> {then} Close,> {else} If((C*1.1) <= 
  PREV,> {then}(C*1.1),> {else} PREV));>> I'm using 
  two triggers.  But I've got no idea of how a fixed trailing> stop 
  loss would be set up.  Perhaps as a trailing band (similar to the> 
  volatility and standard diviation stops) so the "volatility" for the> 
  band could be the fixed trailing stop loss forumula?>> I would 
  imagine the set up might work as below but if anyone knows for> sure, 
  has done a fixed trailing stop, I'd love to know how you did 
  it.>> Trigger1:= (trade system exit conditions);> 
  Volatility:= (trailing stop loss formula?);> 
  BandLong:=ExtFml("TradeSim.TrailingStop",> Trigger,> 
  Long,> Volatility,> CLOSE,> ExitTrigger:= Trigger1 or 
  Trigger2To 
  unsubscribe from this group, send an email 
  to:equismetastock-unsubscribe@xxxxxxxxxxxxxxxYour 
  use of Yahoo! Groups is subject to the <A 
  href="">Yahoo! Terms of Service. 







Yahoo! Groups Sponsor


  ADVERTISEMENT 









To unsubscribe from this group, send an email to:
equismetastock-unsubscribe@xxxxxxxxxxxxxxx





Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.