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

[amibroker] PO_Prob system code ?



PureBytes Links

Trading Reference Links

Hi ! Can somebody help me. The code below is for 
tradestation/EasyLanguage. I have problems coding it in AmiBroker.
Does anyone have any idea what the EasyLanguage funktions 
volatility,ProbAbove and ProbBelow does?
Regards pw


{PO_Prob system code.

by Pierre Orphelin - Sirtrade Intl. 2002 }

inputs:len(50), {lookback volatility period}

len1(20), {target smoothing}

len2(10), {oscillator smoothing} 

len3(10), {oscillator average} 

nex(2), {bars in advance}

fac(1), {percentage of move to expect}

pt(0), {point stop increment}

type(0); {Decision type - see code below} 

 

{I- PO_ Prob Oscillator calculations

================================}

 

value0=volatility(len);

value1=ProbBelow(average(l[1],len1)*(1-0.01*fac),c, value0, nex);

value2=ProbAbove(average(h[1],len1)*(1+0.01*fac),c, value0, nex);

 

value3=100*xaverage(value2-value1,len2);

value4=xaverage(value3,len3);

 

{II- Decision to take according to type value.

This is in fact a 3 systems in one.

===================================}

 

{Type = 0 

===> PO_ Prob Oscillator baseline crossover system}

 

if type=0 then begin

if value3>0 then buy at h + pt points stop;

if value3<0 then sell at l-pt points stop;

end;

 

{Type = 1

===> PO_ Prob Oscillator moving average crossover}

if type=1 then begin

if value3>value4 then buy at h + pt points stop;

if value3<value4 then sell at l-pt points stop;

end;

 

{Type = 2 

===> PO_ Prob Oscillator slope change}

if type=2 then begin

if value3>value3[1] then buy at h + pt points stop;

if value3<value3[1] then sell at l-pt points stop;

end;




------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark
Printer at Myinks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/l.m7sD/LIdGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/