inputs:Prof(0),protstopamt(0),bkoutbuy(10),Bkoutse ll(0),bkbuy(0),bksell(0),r(4),s(6),u(5),
smthlen(3),price(close),raw(25),smoothed(13),smoth len(5);
var:High1(0),Low1(0),high2(0),low2(0),Myexitstop(0 ),blueline(0),redline(0),blackline(0),
yellowline(0),EtsiBuy(false),EtsiSell(false),TsiBu y(false),Tsisell(false),Candlebuy(0),
Candlesell(0),threebarhigh(0),threebarlow(0),
canbuytrade(false),canselltrade(false),failbuy(0), failsell(0);
value1=close;
value2=entriestoday(date);
{condition1=high[2]>high[1]and high[1]>high;
condition2=low[2]<low[1]and low[1]<low; }
Blueline=Tsi(Price,r,s,u);{ETSI Value part 1 of 2}
Redline=XAverage(Tsi(Price,r,s,u),SmthLen);{Signal Line Average Of ETsi part 1 above}
EtsiBuy=Blueline crosses over Redline ;
EtsiSell=Blueline crosses under Redline ;
Blackline=Tsi(price,raw,smoothed,1);{Tsi value part 1 of 2}
YellowLine=XAverage(Tsi(price,raw,smoothed,1),smot hlen);{Signal line Average of Tsi part 1 above}
TsiBuy=Blackline crosses over yellowline ;
TsiSell=Blackline crosses under yellowline ;
If Marketposition =(0) and time >0700 and time < 1330 and value2<5 then
begin
If close<close[1]and close[1]<close[2]then
begin
threebarlow=low[2];
end;
If close>close[1]and close[1]>close[2]then
buy("Buy 3Highs")4 contracts next bar at low[2] limit;
If close<close[1]and close[1]<close[2]then
begin
Threebarhigh=high[2];
end;
If close<close[1]and close[1]<close[2]then
Sellshort("Sell 3Lows")4 contracts next bar at threebarhigh limit;
end;
If MarketPosition = 1 then
begin
If value1<entryprice and barssinceentry>1 then
sell ("Failbuy")next bar at entryprice limit;
myExitStop = entryprice - protstopamt points;
sell("MMLStop")next bar at myExitStop stop;
If CurrentContracts = 4 then
Sell("tgts")2 contracts next bar at entryprice + prof points limit
else
If CurrentContracts = 2 then
Sell("tgts1")1 contract next bar at entryprice + 4 points limit
else
If CurrentContracts = 1 then
myExitStop = maxlist(myExitStop,lowest(low,5));
Sell("trlsell")1 contract next bar at myExitStop stop;
end;
If MarketPosition = -1 then
begin
If value1>entryprice and barssinceentry >1 then
buytocover("Failsell")next bar at value1 limit;
myExitStop = entryprice + protstopamt points;
buy to cover ("MMSStop") next bar at myExitstop stop;
If CurrentContracts =4 then
BuytoCover ("tgtB")2 contracts next bar at entryprice - prof points limit
else
If CurrentContracts =2 then
BuytoCover ("tgtb1")1 contract next bar at entryprice - 4 points limit
else
If CurrentContracts = 1 then
myExitStop = minlist(myExitStop,highest(high,5));
BuytoCover("trlbuy")1 contract next bar at myExitStop stop ;
end;
setexitonclose;
Comment