Duplicate entries

I run a 1M time frame strategy on TV with a lot of pairs witch generates a lot of repeated buy and sell signals from the same pair to mt4 expert advisor. I´ve set the pyramiding to 1 and hedging to false.
With the current settings to many trades that are in red are getting closed if an opposite signal arrives. If i turn the hedging to true the problem will be that i will have multiple buys and sells from the same pair open, because the pyramiding only limits consecutive buys or sell orders( if the signals are alternating they will not be blocked).

Is there a way to only have one position open per pair (buy or sell) and block all incoming signals until that open position closes.

Thank you and best regards,

try like this:

strategy.exit("Exit Short", from_entry="Enter Short", alert_message="Close")

then when you set alert for tradingview.to :
{{strategy.order.alert_message}} {{ticker}} q=0.01  

it works for me. Cheers

Thanks for the input.

That sounds like your strategy needs some work.