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)
Looking for help with contrarian use of a pivot breakout
Hey all. I'm looking for some help with a switch or maybe a series of switches when using a pivot. I want to test a theory that a breakout/breakdown of a pivot high/low has a tendency to retrace momentarily. Here's a summary and example of what I'm trying to do:
Find a pivot high, record that value, look for a break and close above that value and go short. I have this working, but my problem is only doing it once. See image below, pivot at 4094.75 and horizontal line extended across for ease of reference.
Here's the code I used to do this:
This stopped repeated occurrences except when the bars dip back below the recorded pivot high and break above again as in the picture (albeit slightly in this example). I'm drawing a blank on a way to turn off the setup after just one close above. Needs to reset when a new pivot is discovered. Any ideas?
Can you help answer these questions from other members on NexusFi?
I think I get what you want. You are attempting to stop the entries after the first entry. I'd code an input for how many entries were allowed in a day and a counter so that only x entries may take place in a day. But that's me. I'd like to see what happens when I allow x entries and what I might learn from them. I see that both entries were green so .... why not allow multiple entries?
But... if you just want to stop multiple entries, I suspect you will need to zero or null the controlling variable after each bar has been evaluated -- looks to me like that variable is Value2. I've not tried/tested your code so take my suggestion with a grain (or more) of salt.