How to avoid multiple buy/sell signals for the same scrip?

#1
Dear all, I am facing trouble with an afl that I created.The condition for buy is stoch below a value and for exit is is RSI above a specified value.
But once buy is executed in a scrip, I do not want the next candle to generate a buy signal even if it satisfies the buy condition. I want no more buy signals in the same scrip till the position is covered.
Also once sell is executed, the next few candles may still show sell because the conditions for sell are satisfied.(ie, RSI above 55,say)..
How do I get through this problem?Can anyone help me?Thanks..
 

asnavale

Well-Known Member
#2
Dear all, I am facing trouble with an afl that I created.The condition for buy is stoch below a value and for exit is is RSI above a specified value.
But once buy is executed in a scrip, I do not want the next candle to generate a buy signal even if it satisfies the buy condition. I want no more buy signals in the same scrip till the position is covered.
Also once sell is executed, the next few candles may still show sell because the conditions for sell are satisfied.(ie, RSI above 55,say)..
How do I get through this problem?Can anyone help me?Thanks..
Use ExRem to remove extra signals. For example:

If your AFL has BUY and Sell defined as:

Buy = (some condition);
Sell = (some other condition);

Now add the following two lines after the Buy = ... and Sell = ... lines:

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

The extra signals will be removed.

-Anant
 
#3
Use ExRem to remove extra signals. For example:

If your AFL has BUY and Sell defined as:

Buy = (some condition);
Sell = (some other condition);

Now add the following two lines after the Buy = ... and Sell = ... lines:

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

The extra signals will be removed.

-Anant
Thanks a lot for the reply, Anant..
 
#4
Hi Anant/others,

I have one more doubt.. When I back test the afl I get some results.But when I perform scan for the same time period I get more entries and exits.Why is this so? I had used the above as you have said and thus I dont have any multiple entries.
But some other symbols are showing in the scan, but not in the backtest. Is scan and backtest different??
 
#5
Hi Anant/others,

I have one more doubt.. When I back test the afl I get some results.But when I perform scan for the same time period I get more entries and exits.Why is this so? I had used the above as you have said and thus I dont have any multiple entries.
But some other symbols are showing in the scan, but not in the backtest. Is scan and backtest different??
Because Scan just outputs signals but backtest includes other parameters like whether you still have enough capital available. If your system is a loser and you have no capital anymore you are broke just like in real life. So trading stops.

If Scan would be the same as Backtest then Scan wouldn't be called Scan, right? Use your brain.
 
#8
Is there anyway to avoid multiple signals of different scripts but at the same group or watchlist? Anyone signal in the watchlist is enough. This is to avoid entering different options strike prices. @asnavale
 
#9
Hello everyone! My query is even I keep getting repeated buy/sell signals even after trade criteria has met for 1 time. For example, let me explain.

In below screenshot, Sell was generated on 10.21 AM at 753.5/- as per strategy. Now target is set at 734/- as per 2.5% and stop loss is set at 760.5/- as per 1%. But before any of these can get hit, I'm getting multiple unnecessary scans/arrows/signals. This creates a lot of confusion as there are too many stocks in one day with such signals. Please guide how to avoid these.


1589186221097.png

1589186236354.png
 
#10
BuyR = Cross (C,fWHigh) AND BarsSinceOpen == (p+1);
ShortR = Cross(fwLow,C) AND BarsSinceOpen == (p+1);

dn = DateNum();
newDay = dn != Ref( dn,-1);
OneTrade = Flip(newDay, Ref(BuyR, -1));
OneTrade1 = Flip(newDay, Ref(ShortR, -1));
Buy = BuyR AND oneTrade;
Short = ShortR AND OneTrade1;


in this cahnge buyr and shortR with ur conditions.. it would give only one signal pwr day
 

Similar threads