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

Re: [amibroker] Fw: Metastock's formula into AFL



PureBytes Links

Trading Reference Links

ticker="^NDX";//ticker must be enclosed in "" marks.

P=Foreign(ticker,"C");

//Enter Long:
Buy= MA(C,6) > Ref(MA(C,6),-1) AND
MA(P,3) > MA(P,25) AND
Hold(Cross(MA(C,9),MA(C,18)),10);

// Close Long:
Sell= Cross(MA(C,18),MA(C,9));

// Enter Short:
Short= MA(C,6) < Ref(MA(C,6),-1) AND
MA(P,3) < MA(P,25) AND
Hold(Cross(MA(C,18),MA(C,9)),10);

// Close Short:
Cover= Cross(MA(C,9),MA(C,18));

Buy=ExRem(Buy,Sell);Sell=ExRem(Sell,Buy);
Short=ExRem(Short,Cover);Cover=ExRem(Cover,Short);

Filter=1;
AddColumn(Buy,"buy");AddColumn(Sell,"sell");
AddColumn(Short,"short");AddColumn(Cover,"cover");

/* Maximum Loss Stop:
Long AND Short positions
Maximum loss of 0.016 points.


Initial Equity:
Points only
Positions:
Long AND Short
Trade Price:
Open
Trade delay:
1*/

Inwind wrote:

> Can someone please convert this Metastock's formula into AFL - Thanks
>

Enter Long:
Mov(C,6,S) > Ref(Mov(C,6,S),-1) AND
Mov(P,3,S) > Mov(P,25,S) AND
Alert(Cross(Mov(C,9,S),Mov(C,18,S)),10)

Close Long:
Cross(Mov(C,18,S),Mov(C,9,S))

Enter Short:
Mov(C,6,S) < Ref(Mov(C,6,S),-1) AND
Mov(P,3,S) < Mov(P,25,S) AND
Alert(Cross(Mov(C,18,S),Mov(C,9,S)),10)

Close Short:
Cross(Mov(C,9,S),Mov(C,18,S))

Maximum Loss Stop:
Long and short positions
Maximum loss of 0.016 points.
>



Initial Points only
equity:

Positions: Long and
short

Trade Open
Price:

Trade 1
delay:
> ThanksPeter
>
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.