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

Re: "Consec" coding problem



PureBytes Links

Trading Reference Links

The MRO function returns -1 for false, then for true 0 then 1 then 2 etc.
If the MRO is plotted as, IF MRO(Close > Close[1],Consec,1)> -1 then it will
plot the next three bars as true every time C>C[1]
To get it to only plot after 3 Consec bars are true the MRO function is used
in reverse to plot a false condition.
If the > -1 is changed to = -1 and C>C[1] is changed to C<C[1] then
the MRO is = -1 when C>C[1] is true for Consec bars
It may help to write two showmes to see the differences.

Input: Consec(3);
IF MRO(C>C[1],Consec,1)>-1 Then Begin
  Plot1(Low,"ShowMe");
IF MRO(C<C[1],Consec,1)=-1 Then Begin
  Plot1(High,"ShowMe");

Neville


-----Original Message-----
From: Chowwchoww@xxxxxxx <Chowwchoww@xxxxxxx>
To: omega-list@xxxxxxxxxx <omega-list@xxxxxxxxxx>
Date: Tuesday, January 30, 2001 8:33 AM
Subject: "Consec" coding problem


>
>Hello, I hope someone can help me out with a problem concerning the
>consecutive function. Playing around with adding contracts to an existing
>position but I haven't been able to get this to work even entering a new
>position. I opened the "ConsecCriteria" function for a hint. Do I need a
>true-false statement to make this work, and what exactly is the -1 doing at
>the end of the statement?
>
>
>Input: Consec(3);
>
>If MarketPosition = 1 Then Begin
>   IF MRO(Close > Close[1],Consec,1) = -1   and
>       MRO(volume(1) > volume(1)[0],Consec,1) = -1  and
>       MRO(openint > openint[1],Consec,1) = -1 Then Buy on Close;
>End;
>
>Or could I incorporate all 3 into 1 condition to do the same thing such as:
>
>If MarketPosition = 1 Then Begin
>   IF MRO(Condition1,Consec,1) = -1 Then Buy on Close;
>End;
>
>Thanks for any help
>
>Walter
>
>





  • Follow-Ups: