PureBytes Links
Trading Reference Links
|
hit the 64 limit
============
vars:
day1(false),day2(false),day3(false),day4(false),day5(false),day0(false),de1(
0),de2(0),de3(0),de4(0),de5(0),db1(0),db2(0),db3(0),db4(0),db5(0),close1(0),
close2(0),close3(0),close4(0),close5(0),high1(0),high2(0),high3(0),high4(0),
high5(0),low1(0),low2(0),low3(0),low4(0),low5(0),buymon(false),sellmon(false
),buytue(false),selltue(false),buywen(false),sellwen(false),buywenF(false),s
ellwenF(false),buythu(false),sellthu(false),buyfri(false),sellfri(false);
{DAY FLAG SET}
if @dayofweek(date)=1 then begin day1=true; end Else if @dayofweek(date)=3
then begin day1=false; end;
if @dayofweek(date)=2 then begin day2=true; end Else if @dayofweek(date)=4
then begin day2=false; end;
if @dayofweek(date)=3 then begin day3=true; end Else if @dayofweek(date)=5
then begin day3=false; end;
if @dayofweek(date)=4 then begin day4=true; end Else if @dayofweek(date)=1
then begin day4=false; end;
if @dayofweek(date)=5 then begin day5=true; end Else if @dayofweek(date)=2
then begin day5=false; end;
If @dayofweek(date)=0 then begin day0=true; end Else if @dayofweek(date)=3
then begin day0=false; end;
{BARCOUNT & VALUE 1..5 SET}
if day1=true and @dayofweek(date)=1 and time=830 then begin db1=barnumber;
end;
if day1=true and @dayofweek(date)=1 and time=1350 then begin de1=barnumber;
end;
if day2=true and @dayofweek(date)=2 and time=830 then begin db2=barnumber;
end;
if day2=true and @dayofweek(date)=2 and time=1350 then begin de2=barnumber;
end;
if day3=true and @dayofweek(date)=3 and time=830 then begin db3=barnumber;
end;
if day3=true and @dayofweek(date)=3 and time=1350 then begin de3=barnumber;
end;
if day4=true and @dayofweek(date)=4 and time=830 then begin db4=barnumber;
end;
if day4=true and @dayofweek(date)=4 and time=1350 then begin de4=barnumber;
end;
if day5=true and @dayofweek(date)=5 and time=830 then begin db5=barnumber;
end;
if day5=true and @dayofweek(date)=5 and time=1350 then begin de5=barnumber;
end;
value1=de1-db1; value2=de2-db2; value3=de3-db3; value4=de4-db4;
value5=de5-db5;
{DAILY CLOSE, HIGH, LOW SETTING}
if day1=true and @dayofweek(date)=1 and time=1350 then begin close1=close;
high1=highest(high,value1); low1=lowest(low,value1); end;
if day2=true and @dayofweek(date)=2 and time=1350 then begin close2=close;
high2=highest(high,value2); low2=lowest(low,value2); end;
if day3=true and @dayofweek(date)=3 and time=1350 then begin close3=close;
high3=highest(high,value3); low3=lowest(low,value3); end;
if day4=true and @dayofweek(date)=4 and time=1350 then begin close4=close;
high4=highest(high,value4); low4=lowest(low,value4); end;
if day5=true and @dayofweek(date)=5 and time=1350 then begin close5=close;
high5=highest(high,value5); low5=lowest(low,value5); end;
condition1=day1=true and @dayofweek(date)=1 and time=1400 and
currententries=0 and @positionprofit(1)>=0;
{ALTERNATE RULES}
if day1=true and @dayofweek(date)=1 and time=1400 and currententries=0 and
@positionprofit(1)<0 then begin
buymon=true;
sellmon=true;
end;
if day2=true and time=1200 or currententries=1 then begin
buymon=false;
sellmon=false;
end;
if day2=true and @dayofweek(date)=2 and time=1400 and currententries=0 and
@positionprofit(1)<0 then begin
buytue=true;
selltue=true;
end;
if day3=true and time=1300 or currententries=1 then begin
buytue=false;
selltue=false;
end;
if day3=true and @dayofweek(date)=3 and time=1400 and currententries=0 and
@positionprofit(1)<0 then begin
buywen=true;
sellwen=true;
end;
if day4=true and time=1300 or currententries=1 then begin
buywen=false;
sellwen=false;
end;
if day4=true and @dayofweek(date)=4 and time=1400 and currententries=0 and
@positionprofit(1)<0 then begin
buythu=true;
sellthu=true;
end;
if day5=true and time=1300 or currententries=1 then begin
buythu=false;
sellthu=false;
end;
{EXITRULES FOR ALL DAYS}
If time=1450 and @positionprofit(0)<0 and currentcontracts=1 then begin
exitlong at the market; exitshort at the market; end;
{MONDAY ENTRY RULES}
{LONG}
{{1}if condition1 and close1>close5 and low1<low5 and high1>high5 then buy
at the close;
if buymon=true and close1>close5 and low1<low5 and high1>high5 then buy
at close1- 5 points limit;}
{2}if condition1 and close1>close5 and low1>low5 and high1>=close1 + 4
points then buy at the close;
if buymon=true and close1>close5 and low1>low5 and high1>=close1 + 4
points then buy at close1 - 5 points limit;
{3}if condition1 and close1>close5 and low1<low5 and high1<high5 and
high1>close1 + 3 points then buy at the close;
if buymon=true and close1>close5 and low1<low5 and high1<high5 and
high1>close1 - 3 points then buy at close1 - 5 points limit;
{4}if condition1 and close1<close5 and high1>close1 + 3 points then buy at
the close;
if buymon=true and close1<close5 and high1>close1 + 3 points then buy at
close1 - 5 points limit;
{SHORT}
{1}if condition1 and close1>close5 and low1<low5 and high1<high5 and
high1<close1 + 4 points then sell at the close;
if sellmon=true and close1>close5 and low1<low5 and high1<high5 and
high1<close1 + 4 points then sell at close1+ 5 points limit;
{2}if condition1 and close1>close5 and low1>low5 and high1<close1 + 4 points
then sell at the close;
if sellmon=true and close1>close5 and low1>low5 and high1<close1 + 4
points then sell at close1 + 5 points limit;
{3}if condition1 and close1<close5 and high1<close1 + 4 points then sell at
the close;
if sellmon=true and close1<close5 and high1<close1 + 4 points then sell at
close1 + 5 points limit;
{TUESDAY ENTRY RULES}
{LONG}
condition2=day2=true and @dayofweek(date)=2 and time=1400 and
currententries=0 and @positionprofit(1)>=0;
if condition2 and close2>close1 and low2<low1 and high2>high1 then buy at
the close;
if buytue=true and close2>close1 and low2<low1 and high2>high1 then buy at
close2 - 5 points limit;
if condition2 and close2>close1 and low2<low1 and high2<high1 and
high2>close2 + 4 points
then buy at the close;
if buytue=true and close2>close1 and low2<low1 and high2<high1 and
high2>close2 + 4 points then
buy at close2 - 5 points limit;
if condition2 and close2>close1 and low2>low1 and high2>close2 + 4 points
then buy at the close;
if buytue=true and close2>close1 and low2>low1 and high2>close2 + 4 points
then buy at close2 - 5 points limit;
{SHORT}
if condition2 and close2>close1 and low2<low1 and high2<high1 and
high2<close2 + 4 points then sell at the close;
if selltue=true and close2>close1 and low2<low1 and high2<high1 and
high2<close2 + 4 points then sell at close2 + 5 points limit;
if condition2 and close2>close1 and low2>low1 and high2<close2 + 4 points
then sell at the close;
if selltue=true and close2>close1 and low2>low1 and high2<close2 + 4 points
then sell at close2 + 5 points limit;
if condition2 and close2<close1 then sell at the close;
if selltue=true and close2<close1 then sell at close2 + 5 points limit;
{WENSDAY ENTRY RULES}
{LONG}
condition3=day3=true and @dayofweek(date)=3 and time=1400 and
currententries=0 and @positionprofit(1)>=0;
condition4=day3=true and @dayofweek(date)=3 and time=1400 and
currententries=0;
if condition3 and high3 - 5 points <= close3 then buy at the close;
if buywen=true and high3 - 5 points <= close3 then buy at close3 - 5 points
limit;
if condition4 and high3 - 5 points >= close3 and close3>low3 + 5 points
then begin
buywenF=true;
sellwenF=true;
Exitlong at the market;
Exitshort at the market;
end
Else
if dayofweek(date)=4 and time=1350 then begin
buywenF=false;
sellwenF=false;
end
Else
if dayofweek(date)=4 and currententries=1 then begin
buywenF=false;
sellwenF=false;
end;
if buywenF=true then buy at close3 - 15 points limit;
if sellwenF=true then sell at close3 + 15 points limit;
{SHORT}
if condition3 and high3 - 5 points >= close3 and close3<= low3 + 5 points
then sell at the close;
if sellwen=true and high3 - 5 points >= close3 and close3<=low3 + 5 points
then sell at close3 + 5 points limit;
condition4=day4=true and @dayofweek(date)=4 and time=1400 and
currententries=0 and @positionprofit(1)>=0;
{THURSDAY ENTRY RULES}
{LONG}
if condition4 and close4>close3 and low4<low3 and high4>high3 then buy at
the close;
if buythu=true and close4>close3 and low4<low3 and high4>high3 then buy at
the close4 - 5 points limit;
if condition4 and close4>close3 and low4<low3 and high4<high3 and
high4>close4 + 4 points then buy at the close;
if buythu=true and close4>close3 and low4<low3 and high4<high3 and
high4>close4 + 4 points then buy at close4 - 5 points limit;
if condition4 and close4>close3 and low4>low3 and high4>close4 + 4 points
then buy at the close;
if buythu=true and close4>close3 and low4>low3 and high4>close4 + 4 points
then buy at close4 - 5 points limit;
{SHORT}
if condition4 and close4<close3 then sell at the close;
if sellthu=true and close4<close3 then sell at the close4 + 5 points limit;
if condition4 and close4>close3 and low4<low3 and high4<high3 and
high4<close4 + 4 points then sell at the close;
if sellthu=true and close4>close3 and low4<low3 and high4<high3 and
high4<close4 + 4 points then sell at close4 + 5 points limit;
if condition4 and close4>close3 and low4>low3 and high4<close4 + 4 points
then sell at the close;
if sellthu=true and close4>close3 and low4>low3 and high4<close4 + 4 points
then sell at the close4 + 5 points limit;
{FRIDAY ENTRY RULES}
condition5=day5=true and @dayofweek(date)=5 and time=1350 and
currententries=0 and @positionprofit(1)>=0;
{LONG}
{if condition5 and high5>high4 and low5<low4 and close5>close4 then buy at
the close;
if buyfri=true and high5>high4 and low5<low4 and close5>close4 then buy at
the close5 - 5 points limit;
if condition5 and high5>high4 and low5<low4 and close5<close4 and low5>low4
and high5>close5 + 6 points then buy at the close;
if buyfri=true and high5>high4 and low5<low4 and close5<close4 and low5>low4
and high5>close5 + 6 points then buy at the close5 - 5 points limit;
if condition5 and high5>high4 and low5<low4 and low5>low4 and high5>close5 +
6 points then buy at the close;
if buyfri=true and high5>high4 and low5<low4 and low5>low4 and high5>close5
+ 6 points then buy at the close5 - 5 points limit;
{SHORT}
If condition5 and high5<high4 then sell at the close;
If sellfri=true and high5<high4 then sell at close5 + 5 points limit;
if condition5 and high5>high4 and low5<low4 and close5<close4 and low5<low4
then sell at the close;
if sellfri=true and high5>high4 and low5<low4 and close5<close4 and
low5<low4 then sell at close5 + 5 points limit;
if condition5 and high5>high4 and low5<low4 and close5<close4 and low5>low4
and high5<close5 + 6 points then sell at the close;
if sellfri=true and high5>high4 and low5<low4 and close5<close4 and
low5>low4 and high5<close5 + 6 points then sell at close5 + 5 points limit;
if condition5 and high5>high4 and low5>low4 and low5<low4 then sell at the
close;
if sellfri=true and high5>high4 and low5>low4 and low5<low4 then sell at
close5 + 5 points limit;
if condition5 and high5>high4 and low5<low4 and low5>low4 and high5<close5 +
6 points then sell at the close;
if sellfri=true and high5>high4 and low5<low4 and low5>low4 and high5<close5
+ 6 points then sell at the close5 + 5 points limit;}
|