. I am using unirenko bars to enter long/short on a trend. And it works great, but it keeps taking trades because conditions are true again on the same trend once a trade closes, which makes it enter on the next bar.
I am trying to limit the trades on a single trendline to a specific number I would set in an input variable, for example, 2 or 3. Once no.of trades <= 3, stop trading until trend line reverses. This STOP and Reverse logic already works perfectly, but I won’t to stop trading after 3 trades.
I have used a custom series of type INT where I set the value to 0 on first bar of session, and increment (offset +1) on EnterLong, but I also check the condition if No. Of Trade <= maxTrades variable. I can print values above bar and I can see it incrementing, but I can see that it prints incremented values repeated instead of stopping.
I am looking for a sample with strategy builder similar to some of the other samples like PNL, etc. to borrow logic inspiration and add to my strategy. I can also post screenshots of the setup and logic, but there is quite a number of conditions along side the trade counter that may be confusing (reverse check, time check, tick delays, etc).
Thank you so much for your time and help.

Comment