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)
Entry : Pattern 1 setup
Entry at highest high for buy and lowest low for sell
Must be filled within 2 to 3 bars
Exit : 1) Profit target calculated using the entry setup highest high - lowest low add to the highest high for buy or subtract from the lowest low for sell
2) Or exit on the lowest low for buy and highest high for sell
How to code the above?
Can you help answer these questions from other members on NexusFi?
He did a decent job above, but he's right. You're rules have logic "challenges." Spotting the Highest H and the Lowest L is only possible in retrospect, even if you set a time interval, you don't know it's the highest high until after it's come and gone. (same with LL).
I guess if you're interval holds (2-3 bars) you would seek 3 consecutive HH's and enter a long position or 3 consecutive lower lows and enter a short position.
Again, for your exits, you cannot declare "Highest" or "Lowest" in real time...only in retrospect. You can evaluate a 10 bar period, but again, if for instance, you have a spike on bar #3, how do you know that was the highest high? You simply know it's higher, you cannot enter or exit based on "est."
On a side note, even if you could, wouldn't you want to sell at the high"est" point and buy at the low"est" point?
Did not have any code because the pattern is derived browsing and considering there may be an advantage
The trade is simple a pattern with a fix profit target calculated using the current bar high and low and a exit on the current bar low but only the high must be more compare to preivous high
Your code is correct except for the dynamic profit target and exit
Would you change the code to a fix proft target and exit using the current bar high and low?
That's what I was trying to tell you, you cannot determine the current bar's high/low until it's historical (in the past).
If your exit is based on this bar close, it may or may not be at the high/low. If you set the exit on the open of the next bar, again, it may or may not be at this bar's high low.
If you set the exit to run intrabar, every tick is evaluated and so if a bar opens at 100.00 and moves up to 100.01, then that is the current "high" and would trigger an exit.
But the pattern is a historical pattern and the high and low are determined and orders are placed on these levels
Indicator 1 cross 0 and the bar high > previous bar high and next bar open < bar high place a buy order on the bar high
THE BAR HIGH IS DETERMINED BECAUSE THE NEXT BAR OPEN IS THE CURRENT BAR
No order is placed with next bar open > bar high must be < bar high
Should not say current bar high but rather previous bar high for order placement
If you want it it tick/tick, then you'll have to turn IOG on [IntraBarOrderGeneration=True] and you'll have to hold the value for the indicator...........