Example Trading System

Thank you Patrick205, I am fortunate that nobody in my family was involved but, of course, all our thoughts are with those that have lost loved ones.
 
Quote from sidinuk:

Thank you Patrick205, I am fortunate that nobody in my family was involved but, of course, all our thoughts are with those that have lost loved ones.

God Bless you Sid... the USA and Israel (both of whom are experts in fighting Evil) will undoubtedly offer you all available assistance in hunting down and killing the Evil Doers who so callously attacked your great city... Amen
 
Quote from hans123:

Can you give the modifications, please?

Since your question was your first post I won't tell you to do a search this time. From Dougcs' earlier post in this thread - as he said!

Hope you understand Easylanguage:

Input: EndBOTime(10), StartTradBars(1), XDayofWk(1), admin(0.00), hys(0.00), TrinLimit(0.00);
var: hi(0), lo(0), btime(0), trin(0), stime(0);

DefineDLLFunc: "PUSHPOP.DLL", DOUBLE, "POP", LONG, LONG, LONG;

value1=pop(99,date,time);

if dayofweek(date) <> xdayofwk then begin
trin = c data2;
if currentbar = 1 then begin
btime = calctime(0830, endbotime*barinterval);

stime = calctime(btime, starttradbars*barinterval);
end;

if date>date[1] then begin
hi=h;lo=l;
end;
if time <=btime then begin
hi = maxlist(hi,high);
lo = minlist(lo,low);
end;

if time>=stime and marketposition=0 and time>=btime and time <=1430 then begin
if trin<1-trinlimit and value1>admin then buy (20000/c) shares next bar at hi + hys stop;
if trin>1 + trinlimit and value1<-admin then sell short (20000/c) shares next bar at lo - hys stop;
end;

if marketposition<>0 then begin
sell next bar at lo - hys stop;
buy to cover next bar at hi + hys stop;
end;

if time = 1500 then begin
sell this bar at the close;
buy to cover this bar at the close;
end;

end;

Data1 is IWM
Data2 is $TRINQ

the dll reads adv/(adv+decl) which I use in a number of other studies.

Substitute:

data3 = $adv
data4=$decl
adv = c data3
dec = c data4

then ,
value1 = iff(adv+dec>0 ,adv/(adv+dec), 0);

DS
 
Quote from dougcs:

I agree with your thoughts as all systems have stretches where they are flat or down and it can last months. I like to diversify what I trade and the types of systems I use. This one has been doing fairly well this year for me.

FYI-I trade a modified version of this system on ER2 and it has done fairly well this year:

PL= 8% (as pct of the index value)
W/L ~ 60%

I've posted my modifications earlier in this thread.

DS

Hi dougcs,

May I know what is the average winning and losing trade?

Also, can you post the modifications again but modified again to be used on ER2? The earlier version cannot be used on ER2. I am hopeless with Easylanguage so maybe I have missed something. I ran Sidinuk's system no problem but cannot get the modified version to run on ER2.

Thanks.
 
Input: EndBOTime(10), StartTradBars(1), XDayofWk(1), admin(0.00), hys(0.00), TrinLimit(0.00), MaxSDBORange(2.00), datanum(99), XTime(120);

var: hi(0), lo(0), btime(0), trin(0), stime(0), lx(0), sx(0), borange(0), tcount(0), fricount(0), goshort(false);
var: x1(0), sumx(0), sumy(0), sumxy(0), ix(0), in(0), top1(0), btm1(0), var1(0), sd(0), xt(0), permission(true), golong(false);
array: bkoutrange[1000](0);

DefineDLLFunc: "PUSHPOP.DLL", DOUBLE, "POP", LONG, LONG, LONG;

value1=pop(datanum,date,time);
trin = c data2;

if currentbar = 1 then begin
permission=true;
golong = false;
goshort=false;
btime = calctime(0830, endbotime*barinterval);
stime = calctime(btime, starttradbars*barinterval);
xt = calctime(btime, xtime);
end;

if date>date[1] then begin
permission = true;
hi=h;lo=l;
end;

if time <=btime then begin
hi = maxlist(hi,high);
lo = minlist(lo,low);
lx = (hi+lo)/2;
end;

condition0 = dayofweek(date)<>xdayofwk and borange<=maxsdborange and time>=stime and marketposition=0 and time>=btime and time <=1430 and permission;

if condition0 then begin
condition2= ((trin<1-trinlimit and value1>admin) or value1>0.05);
if condition2 then buy 500 shares next bar at hi + hys stop;

condition3 = trin>1 + trinlimit and value1<-admin;
if condition3 then sell short 500 shares next bar at lo - hys stop;
end;

if marketposition<>0 then begin
permission=false;
sell next bar at lo - hys stop;
buy to cover next bar at hi + hys stop;
end;

if barstoclose<=1 then begin
sell this bar at the close;
buy to cover this bar at the close;
end;

I use the pushpop dll to feed ADV/(ADV+DEC) -0.5 data to this as well as other studies I trade. So to set up your chart, use 15 minutes using IWM as data1 (I trade it and ER2 depending on various portfolio factors but I've found they are fairly interchangeable. ) You would need $TRINQ as data2, $ADVQ as data3 and $DECLQ as data 4. You would then substitute value1= (c data3/(c data3 + c data4))-0.5 for the "POP" statement.

DS
 
Quote from dougcs:



if barstoclose<=1 then begin
sell this bar at the close;
buy to cover this bar at the close;
end;


DS



I am using TS 8.1 and it somehow does not seem to recognize "barstoclose". Would anyone know the equivalent term for this in TS 8.1.

Thanks in advance for any help.
 
Doug,

What version of TS is that?

I haven't seen a Performance Summary Report since TS4. Its amazing the number of additional statistics on it now.

Brooks
 
Back
Top