I want the rule to not enter the market if i have taken a trade within say the last 10 bars.
By “taken a trade” i mean if i have just finished a trade. If the trade was profitable i dont want to enter the market within the next 10 bars. If there is no way of seeing whether or not the last trade was a profit or loss i would still try to backtest the rule.
You have to use a variable to start counting bars when you exit a trade (you have to check you are NOT LONGONMARKET now but were LONGONMARKET the previous bar) and set another variable to disable trading