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

Re: question



PureBytes Links

Trading Reference Links

Try it this way John :   Col A = Long filter : If(         MACD() > 0 AND C > Mov(C,10,E) AND RSI(21) > 50 AND Cross(MACD(), Mov(MACD(),9,E) AND C <= BBandTop(C,20,S,2) AND C >= BBandBot(C,20,S,2) AND H >= Ref(HHV(H,30),-1) AND C > Ref(C,-1),         +1,0) Col B = Short filter : If(         MACD() < 0 AND C < Mov(C,10,E) AND RSI(21) < 50 AND Cross(Mov(Macd(),9,E),Macd()) AND C <= BBandTop(C,20,S,2) AND C >= BBandBot(C,20,S,2) AND L <= Ref(LLV(L,30),-1) AND C < Ref(C,-1)),         +1,0) To get the result in a binary form, you can add a Col C, with : A:= If( MACD() > 0 AND C > Mov(C,10,E) AND  RSI(21) > 50 AND Cross(MACD(), Mov(MACD(),9,E) AND C <= BBandTop(C,20,S,2) AND C >= BBandBot(C,20,S,2) AND H >= Ref(HHV(H,30),-1) AND C > Ref(C,-1)),+1,0); B:= If( MACD() < 0 AND C < Mov(C,10,E) AND  RSI(21) < 50 AND Cross(Mov(MACD(),9,E),MACD()) AND C <= BBandTop(C,20,S,2) AND C >= BBandBot(C,20,S,2) AND L <= Ref(LLV(L,30),-1) AND C < Ref(C,-1),-1,0); A + B { Then you don't need anymore ColA and ColB } And one can also add in the Filter, the same as in col C, but with an " A OR B " instead " A plus B " at the end.       Ave,                             john graham duff a écrit : i,ve written the formulas below to screen stocks/indices for long and short trades, to include the criteria : macd to be above/below 0,                  close price above/below 10 dma, 21 period rsi to be above/below 50,      macd to be crossing above/below the 9 period signal line, price within bollinger bands, the price at a new 30 day high/low and the price to be higher/lower than yesterday's close. these formulas seem to work but i,m not sure that i,m using the correct syntax the price is the highest/lowest for 30 days,this part of the formula does not work ? could you please give the formulas a quick check over, cheers, john             (long filter) If (MACD() > 0  AND CLOSE > Mov(CLOSE,10,E) AND RSI(21) > 50 AND MACD() > Mov(MACD(),9,E) AND CLOSE < Mov(C,20,S) + (2*(Std(C,20))) AND CLOSE > Mov(C,20,S) - (2*(Std(C,20))) AND HHV(H,30), AND CLOSE > ref(close,-1) +1, 0) (short filter) If(MACD() < 0 AND CLOSE < Mov(CLOSE,10,E) AND RSI(21) < 50 AND MACD() < Mov(MACD(),9,E) AND CLOSE < Mov(C,20,S) + (2*(Std(C,20))) AND CLOSE > Mov(C,20,S) - (2*(Std(C,20))) AND CLOSE < ref(close,-1) and llv(l,30) ,+1, 0)  

  • References: