count of number of Candelsticks
Forums › ProRealTime English forum › ProOrder support › count of number of Candelsticks
- This topic has 11 replies, 3 voices, and was last updated 1 year ago by JS.
-
-
04/04/2023 at 11:36 PM #21281404/05/2023 at 7:00 AM #21281504/05/2023 at 11:07 AM #212827
Hi JS,
thank you for your help.
it’s the opposite but the meaning is that one.
Support=10
If Close Crosses under Support and Summation[10](Close crosses over Support)=1 then
Buy 1 contract at Market
EndIfI do not understand why you put “=1”
it would be the same if I write Close>support?
04/05/2023 at 11:12 AM #21282804/05/2023 at 11:23 AM #212829If I understand correctly your code, it buys at market only if price cross over support, then it goes down at least once and up again within 10 candles
Support=10
If Close Crosses Over Support and Summation[10](Close crosses under Support)=1 then
Buy 1 contract at Market
EndIfwhat I’m looking for is:
price crosses down support, and then if it crosses over again within 10 candles, buy at market. If not, don’t buy.
04/05/2023 at 11:36 AM #212831In case JS is busy, I’ll add a bit so to keep you moving on your strategy 😉
If you backtest JS code in a strategy with below added, you will see that the code works as you want.
1GRAPH Summation[10](Close crosses under Support)=104/05/2023 at 12:55 PM #21284604/05/2023 at 1:17 PM #212855Yes, the code is saying … if during the last 10 bars, price crossed under 10 once and once only; BUY when price crosses over 10.
So the BUY would be on Bar 11 out of every count of 11 bars. Has to be else how could we count 1 (1 ONLY) crosses under over the last 10 bars?
04/05/2023 at 1:29 PM #212856The crosses-under could be on any bar from Bar 1 to Bar 10, so we could have a crosses under on Bar 10 then a crosses over on Bar 11 and that would satisfy the Conditions … is that what you want??
I’m sure JS can sort you whatever you need and I can work it out in plain English (maybe?) 😉
04/05/2023 at 1:41 PM #212857If crosses under was ONLY on Bar[12] (meaning 12 bars ago) and crosses over is on Bar[0] (meaning current Bar then the conditions would not be satisfied and there would be no BUY trade executed.
It’s best getting Conditions into a working Strategy and backtest it as then you can optimise the Bar Count etc and see if ever what you thought would work does actually work and make profit?
Above is what I do anyway, also it’s more fun than pondering for ages, coding exact conditions which may not make any profit? 😉
Also using the GRAPH function means you can see what is happening and so understand how the code works and so move onwards and upwards re coding knowledge?
04/05/2023 at 2:38 PM #212864thank you Grahal,
my idea is that I give a defined time to recover the support. for example 10 bars. If it’s not able to re-cross over quite immediately that support, probably it’s a fake recover and it can go down again easily, so I don’t want to buy there but I wait for a better confirm if it break a higher resistance.
1 user thanked author for this post.
04/05/2023 at 5:12 PM #212880 -
AuthorPosts
Find exclusive trading pro-tools on