| 
 PureBytes Links 
Trading Reference Links 
 | 
Here it is the idea...
Assumption: In most indexes markets gaps on daily bars are rare
Idea to take advantage of this: to put in open 2 orders, one buy x point
under yesterday close, one sell x point above yesterday close (+ targets and
stop orders as anybody likes).
My original code: I'm a novice EL programmer (I know it's a terrible
code..:-)) , so most of you could improve it
Input:pointAdd(as You like);
var:AttivaHigh(-1),SellOK(-1),AttivaLow(-1),BuyOK(-1);
If  d<>d[1] Then begin
 AttivaHigh=0;
 SellOK=0;
 AttivaLow=0;
 BuyOK=0;
End;
If AttivaHigh=0 and closeD(1)+pointadd<High  Then AttivaHigh=1;
If SellOK=0 and AttivaHigh=1 Then begin
 sell at closeD(1)+pointadd limit;
 SellOK=1;
    buyok=1;
End;
If Time>=1725 {15 min to trading session end}
 then  Exitshort ("exsh") at market;
If AttivaLow=0 and closeD(1)-pointadd>Low  Then AttivaLow=1;
If BuyOK=0 and AttivaLow=1 Then begin
 Buy at closeD(1)-pointadd limit;
 BuyOK=1;
    sellok=1;
   End;
If Time>=1725  {15 min to trading session end}
then  ExitLong ("exLo") at market;
-------
targets and stops are to add (from TS2000 library)
One good idea to better set "x pointadd" is to make reference to yesterday
range or multiply a constant for ATR...
The original problem is that  with
"If  d<>d[1] Then begin....."
this buy/sell the open of second intraday bar...not the first; what I think
it'd be better is buy/sell closeD(1)+/-pointadd on stop but I can't code it
workely...
it's all
I wish somebody will be interested in it.
Mario
 |