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

Re: [EquisMetaStock Group] Re: Help with coding an indicator...Gann HiLo ATR



PureBytes Links

Trading Reference Links

Hi Chorlton


There are two Forum DLLs in this group's files section. Check out http://finance.groups.yahoo.com/group/equismetastock/files/Equis%20Forum%20DLL/

The current Forum Dll is also available as Forum20.dll from the Files section at http://forum.equis.com/ .I suggest you change the name of the DLL to keep to Forum.DLL, purely to save space when calling it. That's not necessary but it can help prevent excessively long ExtFml() calls. What will be necessary if you use the newer 188KB DLL is changing the syntax from VarMov to Mov. VarMov was used in 1 or more earlier versions, no doubt including the one used by Preston's formula. The GH variable would be written like this if you renamed the DLL from Forum20.DLL to Forum.DLL.

GH:=ExtFml( "Forum.MOV", HIGH, ATR(pdatr)*factor,e);

It would be written like this if you retained the Forum20.DLL name when downloading.

GH:=ExtFml( "Forum20.MOV", HIGH, ATR(pdatr)*factor,e);

Obviously the two DLLs cannot reside in the same "External Function DLLs" folder with the same name, but each will work whatever name you give them as long as you change your ExtFml() code syntax to suit. As long as each version has a unique name they can both reside in the same folder.

The larger file is the one with the least issues but that's not to say that all issues have been resolved. There were severe speed problems with the exponential MA function in at least one of the older versions. That problem was resolved with the 188KB file.


Regards

Roy


  ----- Original Message ----- 
  From: chorlton_c_hardy 
  To: equismetastock@xxxxxxxxxxxxxxx 
  Sent: Saturday, July 07, 2007 3:59 PM
  Subject: [EquisMetaStock Group] Re: Help with coding an indicator...Gann HiLo ATR



  Hi Preston,

  When I run this code, I get the following error message : This DLL 
  does not exist in the MSX DLL folder.

  I'm assuming that this is because its trying to call the 
  ExtFml "ForumDLL.VarMOV"? Where can I get this from and how do I 
  incorporate it to make this code work?

  Thanks in advance,

  Chorlton

  --- In equismetastock@xxxxxxxxxxxxxxx, pumrysh <no_reply@xxx> wrote:
  >
  > Chorlton,
  > 
  > On a second thought heres an oldie that you might enjoy.
  > 
  > {Gann HiLo ATR}
  > PdAtr := Input("ATR Periods",1,250,14);
  > Factor:= Input("ATR factor",1,250,7);
  > GH:=ExtFml( "ForumDLL.VarMOV", HIGH, ATR(pdatr)*factor,e);
  > GL:=ExtFml( "ForumDLL.VarMOV", LOW, ATR(pdatr)*factor,e);
  > HLd:=If(CLOSE>Ref(GH,-1),
  > {then}1,
  > {else}If(CLOSE<Ref(GL,-1),
  > {then}-1,
  > {else}0));
  > HLv:=ValueWhen(1,HLd<>0,HLd);
  > HiLo:=If(HLv=-1,
  > {then}GH,
  > {else}GL);
  > HiLo;{end}
  > 
  > 
  > Enjoy,
  > 
  > Preston
  > 
  > --- In equismetastock@xxxxxxxxxxxxxxx, "chorlton_c_hardy" 
  > <micro_dot_uk@> wrote:
  > >
  > > Hi Preston,
  > > 
  > > Wow.... is it that simple? I spent quite a long time trying to 
  > code 
  > > something :-/
  > > 
  > > I'll give it a go.... and Many Thanks......
  > > 
  > > Out of interest, looking at the code, unless the indicator rises 
  > it 
  > > will instead use the previous value and move sideways. This is 
  > > definately part of what I'm after. However, Is there any way to 
  > reset 
  > > it once the price drops below this indicator level?
  > > 
  > > In other words, once I get stopped out, i would like the line to 
  > > revert back to Mov(C,10,E)-2*(ATR(10)).
  > > 
  > > My reasoning for this is that once the price has dropped thru the 
  > > stop level and stabilised I would like to immediately re-enter 
  the 
  > > trade and begin the process again,and obviously at this point the 
  > > price will be trading below what it was previously. Therefore I 
  > would 
  > > like the stop line to do the same. 
  > > 
  > > Is this possible?
  > > 
  > > Chorlton
  > > 
  > > 
  > > --- In equismetastock@xxxxxxxxxxxxxxx, pumrysh <no_reply@> wrote:
  > > >
  > > > Chorlton,
  > > > 
  > > > Something like this?
  > > > 
  > > > stop := Mov(C,10,E)-2*(ATR(10));
  > > > If(stop > Ref(stop,-1),stop,prev);
  > > > 
  > > > Preston
  > > > 
  > > > 
  > > > 
  > > > --- In equismetastock@xxxxxxxxxxxxxxx, "chorlton_c_hardy" 
  > > > <micro_dot_uk@> wrote:
  > > > >
  > > > > --- In equismetastock@xxxxxxxxxxxxxxx, "chorlton_c_hardy" 
  > > > > <micro_dot_uk@> wrote:
  > > > > >
  > > > > > Hello All,
  > > > > > 
  > > > > > I want to code a specific indicator but not sure how to 
  even 
  > > > begin 
  > > > > > coding it :-(
  > > > > > 
  > > > > > Basically, I want to add a moving line to my price chart 
  > which 
  > > > will 
  > > > > > act as a stop loss.
  > > > > > 
  > > > > > This new line (called "Stop Line") should be 2 x the 
  Average 
  > > > True 
  > > > > > Range (ATR) below price (close). As price moves upwards, 
  > this 
  > > > new 
  > > > > > line should be recalculated using the next days price 
  > (close) 
  > > > and 
  > > > > its 
  > > > > > ATR.
  > > > > > 
  > > > > > However, if the price declines, the "Stop Line" should 
  > remain 
  > > at 
  > > > > the 
  > > > > > previous level and NOT be recalculated. In other words, 
  > > > the "Stop 
  > > > > > Line" should only move upwards or horizontal but never 
  > > downwards.
  > > > > > 
  > > > > > Once price crosses back below the "Stop Line", the line 
  > should 
  > > > > then 
  > > > > > be "reset" and return to 2 x ATR below current price 
  > (close). 
  > > > > > 
  > > > > > In summary:
  > > > > > 
  > > > > > 1. "Stop Line" is calculated as: Current close - 2x 
  > Average 
  > > > True 
  > > > > > Range (ATR) 
  > > > > > 2. On the next day: If close is higher than previous day, 
  > > then 
  > > > > > repeat step 1, else keep current value ie. "Stop Line" 
  moves 
  > > > > > horizontal at same value from previous day
  > > > > > 3. Repeat step 2, until close < "Stop Line"
  > > > > > 4. Once close < "Stop Line", return to step 1
  > > > > > 
  > > > > > Any help much appreciated,
  > > > > > 
  > > > > > Many Thanks....
  > > > > > 
  > > > > > CCH
  > > > > >
  > > > > 
  > > > > I forgot to add that the lookback period for the ATR should 
  be 
  > > > 10....
  > > > > 
  > > > > Thanks once again......
  > > > >
  > > >
  > >
  >



   

  __________ NOD32 2383 (20070706) Information __________

  This message was checked by NOD32 antivirus system.
  http://www.eset.com


[Non-text portions of this message have been removed]



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/equismetastock/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/equismetastock/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:equismetastock-digest@xxxxxxxxxxxxxxx 
    mailto:equismetastock-fullfeatured@xxxxxxxxxxxxxxx

<*> 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/