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

My REI function and a more serious problem



PureBytes Links

Trading Reference Links

Here is my REI function which seems to work better for me than the standard:

Inputs:LenS(Numeric);
vars:ReiD(0),ReiF(0),Denom(0),Numer(0);
vars:ReiDL(0),ReiDS(0),ReiFL(0),ReiFS(0),DenomL(0),DenomS(0),NumerL(0),NumerS(0);

Condition1= High>= Low[6] and Low<=High[6];
Condition2= High>=Close[8] and Low[2]<= close[8];


      {REI}
DenomS= Iff(Close=close[1],1,Summation(AbsValue(Close-Close[1]), LenS));
NumerS= High-High[2] + Low-Low[2];
ReiDS=IFF(Condition1 or condition2, NumerS, 0);
Rei= Summation(ReiDS,LenS)/DenomS;

NEW QUESTION
I have done a lot of testing with a system that includes an LX/SX statement 
If Marketposition=1 then Exitlong at nopen-X*range stop;  {where nopen is the next day's open as taken from the next day DLL}

I am trying to convert this for use on a live updating chart (daily) by saying :
If marketposition=1 then Exitlong at Opend(0) -X*range stop;  {this fails as it wants the stop qualified on one bar and executed on the next}
- the nopen call won't work since it doesn't yet know in real time what the next day's open is.
Am I forced to use a 1 minute chart to get the OPEND(0) value set right away so it can be used for the rest of the day?  Is ther no work around so I don't have to change all the code run on a 1 minute chart and have to look at 1 minute bars?
Any ideas?