This should get you started.
It assumes the buy happened on the current
bar - which
at least will give you the sell stop limit.
It could be
refined by getting the BarCount value when
the buy occurred.
Hope it
helps
Rick
_SECTION_BEGIN("Stop Calculator");
//
Stop Calculator
slpoint = Min(L,Ref(L,-1))*0.95; // 5% below lower
of
current day or yesterday
y2 = LastValue(slpoint);
x2 =
BarCount -8; // no. bars back to start the line
plot
x3 = BarCount
-1;
Line = LineArray( x2, y2, x3, y2, 0 );
Plot( Line, "Trend line",
colorWhite);
_SECTION_END();
--- rpc20060610 <rpc200512@xxxxxxcom>
wrote:
> Hi
> I want to draw a Stop Loss line (Horizontal) at
5 %
> below the the
> lower of current bar(where Buy is
triggered) or
> earlier bar whichever
> is lower.I am finding
difficult to determine how to
> find where did last
> buy occur
on the chart from within the AFL.
> Any help in this regard will be
greatly appreciated
> rpc20060610
>
>
Rick Osborn
& Associates
885 Sorrento Ave.
Oshawa, Ontario L1J 6V6
(905)
728-8543 fax 728-0815