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

Re: [EquisMetaStock Group] backtest in AB - result in Metastock - automated trading via Hyperorder



PureBytes Links

Trading Reference Links

Hi Livetraderman,
 
There may be a better way to code it, but this seems to work. I simplified the code to speed it up.
 
Create 3 indicators first:
 
fx livetraderman 8
fx livetraderman 21     (change d1 to 21)
fx livetraderman stop
 
 
----------- indicator "fx livetraderman 8" ---------------
d1:=8;  s1:=.84;  s2:=.7056;  s3:=.5927;
e1:=Mov(C,d1,E);   e2:=Mov(e1,d1,E);
e3:=Mov(e2,d1,E);  e4:=Mov(e3,d1,E);
e5:=Mov(e4,d1,E);  e6:=Mov(e5,d1,E);
c1:=-s3;  c2:=3*(s2+s3);  c3:=-6*s2-3*s1-3*s3;
c4:=1+3*s1+s3+3*s2;
Ti3:=c1*e6+c2*e5+c3*e4+c4*e3;  Ti3
-----------------------------------------------------------
 
---------- "fx livetraderman stop" ---------
Pp:=1.0015;  Pm:=.9985;
If(C = PREV, PREV,
If(Ref(C,-1)<PREV AND C<PREV, Min(PREV,C*Pp),
If(Ref(C,-1)>PREV AND C>PREV, Max(PREV,C*Pm),
  If(C>PREV, C*Pm, C*Pp))));
----------------------------------
 
 
Check if the indicators do what intended, then create a new system with BUY & BUY TO COVER as below, and reverse ">" & "<" for SELL & SELL SHORT. I didn't incorporate your stop, see comment below.
 
----------- system tester BUY ------------
ff:=fml("fx livetraderman 8");  fs:=fml("fx livetraderman 21");
ff>fs and ref(ff,-1)<=ref(fs,-1)
------------------------------------------
 
Need to watch the type of orders, as you may not be allowed to mix the market and stop types (can anyone comment on that?). Hope this helps.
 
I got frustrated with the limitations and errors in MS system tester and do most of my testing in VisualBasic.
 
I'm interested in your approach to autoexecution as I'm looking for the same. Didn't realise that FXCM take orders from MS.
 
Richard
 

Yahoo! Groups Sponsor
Select Your State: Alabama Alaska Arkansas Arizona California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Missippi Missouri Montana Nebraska Nevada New Hampshire New Mexico New Jersey New York North Carolina North Dakota Oklahoma Ohio Oregon Pennsylvania Rhode Island South Carolina South Dakota Tennessee Texas Utah Vermont Virginia Washington Washington D.C. West Virginia Wisconsin Wyoming

Purchase Refinance



Yahoo! Groups Links