Breakout next 5 Bars
Forums › ProRealTime English forum › ProOrder support › Breakout next 5 Bars
- This topic has 46 replies, 5 voices, and was last updated 1 year ago by Chrisinobi.
-
-
01/19/2023 at 5:18 PM #207726
This don’t work. It seems so that there isn’t any solution for this problem. I can’t beleave it, it is only a market order.
01/19/2023 at 6:33 PM #207727Buy 1 contract at High STOP
I might be missing something, but how can we buy at High?
High does not allow for spread?
Surely it needs to be something like … Buy 1 contract at (High-x) STOP?
Or better still …
123If Close > High - x ThenBuy at MarketEndifsame goes for SellShort …
123If Close < Low +x ThenSellShort at MarketEndif01/19/2023 at 7:04 PM #207728Thank you, but im afraid this wont work. Maybe you can take a look at attaced picture?
01/19/2023 at 7:09 PM #207730how can we buy at High STOP? (for example, at bar 100)
During the next bar (or next few bars) we may hit the value that High was on bar 100 (allowing for spread of course).
Is this what is happening killerplatuze
01/19/2023 at 7:11 PM #207731yes, it seems so.
01/19/2023 at 7:53 PM #207732I like this PopGun, it’s simple and < 10 lines of code … makes it easy to work on! 😉
Try below with values A4 to A7 optimised to whatever you think suits your chosen TF and Instrument.
Below fits what you state in the box on your screenshot?
12345678DefParam CumulateOrders=False//PopGunIf High[2]>High[1] and Low[2]<Low[1] and High>High[1] and Low<Low[1] thenBuy 1 contract at High+A4 STOPSet Stop Price High-A5SellShort 1 contract at Low-A6 STOPSet Stop Price Low+A7EndIf1 user thanked author for this post.
01/20/2023 at 10:40 AM #207748Is above code opening trades > 5 bars after trigger bar?
If Yes, that is the next thing to fix.
1 user thanked author for this post.
01/20/2023 at 2:50 PM #207765Many thanks for your help. It seems to be the right way.
The fifth bar should be filled with a short, but isn’t. If the fourth bar breaks out it will be filled with a trade
01/20/2023 at 3:31 PM #207768So 3 was the trigger bar?
What value are you using for A4 and A6 in the code I posted?
1 user thanked author for this post.
01/20/2023 at 5:10 PM #207778Just 5, just wanna see what happened with the bux trigger. The third candle is the buy trigger, One of the next 5 bars must break out, otherwise the popgun will be deleted.
I take 5 for all.
01/21/2023 at 2:03 PM #207825Try this …
12345678910111213141516DefParam CumulateOrders=FalsePopGun = High[2]>High[1] and Low[2]<Low[1] and High>High[1] and Low<Low[1]If PopGun ThenTrigger = barindexTrigHigh = HighTrigLow = LowTradeOn = barindex < Trigger + 5EndifIf PopGun and TradeOn thenBuy 1 contract at TrigHigh+A4 STOPSet Stop Price High-A5SellShort 1 contract at TrigLow-A6 STOPSet Stop Price Low+A7EndIf1 user thanked author for this post.
01/21/2023 at 3:28 PM #207833Above code with small improvement …
12345678910111213141516DefParam CumulateOrders=FalsePopGun = High[2]>High[1] and Low[2]<Low[1] and High>High[1] and Low<Low[1]If PopGun ThenTrigger = barindexTrigHigh = HighTrigLow = LowTradeOn = barindex < Trigger + 5EndifIf PopGun and TradeOn thenBuy 1 contract at TrigHigh+A4 STOPSet Stop Price TrigHigh-A5SellShort 1 contract at TrigLow-A6 STOPSet Stop Price TrigLow+A7EndIf1 user thanked author for this post.
01/21/2023 at 3:32 PM #207834Hi, there ist no trade.
01/21/2023 at 3:51 PM #207835Without A4 and A6 it works, but there is only a trade if the first bar behind the triggerbar breaks out.
There is no trade if the first bar behind the popgung dont breaks out.
It seems to be more difficuilt than expected. Thanks for your help.01/21/2023 at 4:48 PM #207841Works fine for me … see attached.
with values A4 to A7 optimised to whatever you think suits your chosen TF and Instrument.
Please confirm that you are doing above and not trying to run the code with the text – A4, A5, A6 and A7 – in the code??
1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on