Exrem Function Removing valid Buy/Sell for today due to yesterday's data. Need help.

#1
Need basic help. Searched a lot but didnt find much inputs for my issue.

Buy = (Close > Open) AND (Cross( RSI(15),50)) AND (Close > EMA(Close, 20)) AND ( EMA(Close, 20)) > EMA(Close, 50)) ) AND (Close > 100) ;
Sell = (Close < Open) AND (Cross(50, RSI(15))) AND (Close < EMA(Close, 20)) AND ( EMA(Close, 20)) < EMA(Close, 50)) ) AND (Close > 100);

Buy = ExRem(Buy, Sell);
Sell = ExRem(Sell, Buy);

Filter = Buy OR Sell ;

Now whats happening is if I keep Exrem function, its ignoring any signals generated today if there is any signal generated yesterday. E,g, Buy was generated in Bata yesterday at 2:00PM & it ignores any fresh Buy Signal in Bata today morning till a fresh Sell signal is generated & if a new Buy signal is generated again. In short, I want to scan only for todays data starting from 9:15AM. Removing Exrem gives too many signals which is again confusing.


Any help will be much appreciated.
 

Romeo1998

Well-Known Member
#2
at the end of the trading day, we can just assign a sell signal... :)
so new sell would be...
Code:
Sell1 = (Close < Open) AND (Cross(50, RSI(15))) AND (Close < EMA(Close, 20)) AND ( EMA(Close, 20)) < EMA(Close, 50)) ) AND (Close > 100);
Sell2 = TimeNum()>=151500;
Sell = sell1 OR sell2;
good luck :)
 
#3
at the end of the trading day, we can just assign a sell signal... :)
so new sell would be...
Code:
Sell1 = (Close < Open) AND (Cross(50, RSI(15))) AND (Close < EMA(Close, 20)) AND ( EMA(Close, 20)) < EMA(Close, 50)) ) AND (Close > 100);
Sell2 = TimeNum()>=151500;
Sell = sell1 OR sell2;
good luck :)

So it basically scans for stocks based on Sell1 conditions or till time is 3:15PM?

Thanks so much Romeo1998, that worked like a charm. :)

Though am still a novice & trying to figure out the logic as to why is it less than 3:15PM and not the other way of more than 9:15AM :)
 

Romeo1998

Well-Known Member
#4
time more than 915 am will give sell on all the candles after 915 am... n even if we use exrem, the moment we get buy, on next candle we will get sell bcoz time would be more than 915 am.... hence we used time more than equal to 315 pm.... so that at the end of the day if any buy position is open it will get closed n wont be carried forward to the next day... :)
 
#5
time more than 915 am will give sell on all the candles after 915 am... n even if we use exrem, the moment we get buy, on next candle we will get sell bcoz time would be more than 915 am.... hence we used time more than equal to 315 pm.... so that at the end of the day if any buy position is open it will get closed n wont be carried forward to the next day... :)
Thanks much. Really appreciate your response with the details.
 

Similar threads