PureBytes Links
Trading Reference Links
|
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@xxx> 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......
> > >
> >
>
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/
|