Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I’m trying to find a way to have at least a certain number of bars between each entry. For example, I want there be at least six bars between each entry. After another new entry, the strategy must wait at least six bars before it is allowed to add to the position again.
I’m unable to use BarsSinceEntry(0) since it refers to the first entry of the current open position. I tried to create my own function BarsSinceLastEntry to retrieve the information I need.
However, my current code isn’t working properly. When I insert it the strategy will stop adding to existing positions. Below is my own code for my own function BarsSinceLastEntry. I plotted it as an indicator and the functions appears to be working as intented. I’m not sure where I went wrong. Any ideas or suggestions would be greatly appreciated.
Can you help answer these questions from other members on NexusFi?
You might want to take a look into the reserved words PosTradeExitBar and PosTradeEntryBar. They make it possible to receive the specific entry and exit bar even with multi-leg positions.
Another approach would be to monitor a change in your market position or number of trades and save the bar number at this moment. Then you can block new trade entries as long as the new bar number < saved bar number + X.
What is "the same issue"? QuantArb talks about two things that aren't necessarily related: 'bar delay between entries and 'code stops adding to new positions'. Please be more specific if you want help.