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)
In my strategy I want to add a clause that doesn't allow the same strategy to enter until 1 bar after an exit has occurred. What I have come up with is this but it isn't working.
If (barssinceexit>1 or Total Trades<1) then {strategy}. If anyone can clarify why this isn't working please let me know and thank you in advance.
Can you help answer these questions from other members on NexusFi?
I would suggest using the print reserved word to check the value the reserved words hold within your code.
Like @SMCJB mentioned they might only get updated at the end of the bar and you could act on "old" information.
I was just searching for a solution because I have the same problem with barsinceexit(1) and MULTICHARTS. I'm not able to make it work ..
So I tryed you solution by checking the position by using this code:
but it doesn't work!! I can still see on a 15 minutes bar chart 2 consecutive trades , one in a bar and another in the following bar. How's that possible?
is marketposition[1] referring only the the effective market position at the end of a bar? because the first trade has been filled and close INSIDE a 15 minutes bar so at the end of the bar the marketposition is AGAIN zero.
I don't have an answer to your questions about barsinceexit, but I've noticed that you have opened a couple of threads with "barsinceexit(1)" in the title. There seems to be an issue with threads titled this way, which makes them not accessible. There is no issue with just plain "barsinceexit" without the "(1)" -- if you wonder why you're not getting many replies to those posts, this is the reason.
For instance, this thread is fine, and it uses "barsinceexit" alone.
So if you want to post your question, please just refer to "barsinceexit" by itself in the thread title, leaving off the "(1)".
I hope you find your answer.
Bob.
When one door closes, another opens.
-- Cervantes, Don Quixote
Thanks for the suggestion but it doesn't work also using your suggestion... (I'm using multicharts).. I'm struggling to avoid consecutive entries and I cannot make it work...