Swing Lines strategy
Forums › ProRealTime English forum › ProOrder support › Swing Lines strategy
- This topic has 10 replies, 4 voices, and was last updated 5 years ago by Nicolas.
Tagged: Swing Lines
-
-
12/14/2018 at 1:04 PM #87104
Hi @Rorshack,
Thanks a lot for this piece of code; really useful; https://www.prorealcode.com/topic/swing-lines-indicator/
I am looking to translate this indicator into a strategy which was surely your purpose;
di you already code it and if yes would you share it?
Very best,
Chris
12/14/2018 at 1:21 PM #87106Since you want to talk about a strategy I moved your post to ProOrder and inserted a link to the indicator, in your post.
Please use the correct forum when posting. Thank you.
1 user thanked author for this post.
12/17/2018 at 12:04 PM #87281Do you have ideas on how to use the indicator as a strategy? If you could define it precisely, then someone could be able to program it.
Dozens of strategies could be made from a single line on a chart, so take time to have a precise idea and post a full description (and with screenshots if you find them necessary for a better comprehension).
1 user thanked author for this post.
12/17/2018 at 4:23 PM #87303Hi,
I was asking directly @rorshack if he had written whatever stategy on this ;
I am thinking of a combination of strategies that would
- test if the close breaks out the support/ resistance
- verify if the break out is confirmed
- target the next supports/resistance depending on the importance of the level of volume based on volume per price
- set in consequence targets for profit
- adjust with fibonacci test
If anyone had a skeletton, I would appreciate !
Best,
Chris
12/17/2018 at 4:56 PM #87308Unfortunately I haven’t written any strategy based on this indicator because the pro real time API does not allow me to. This indicator itself is very slow and the code is a bit heavy. I abandoned pro real time coding because of this. To write a strategy based on this indicator I needed to deal with arrays but it cannot be done.
Sorry guys!
12/17/2018 at 5:45 PM #87313Hi @rorschack,
So you think I cannot code the strategy I imagine above with PRT?
So on which platform did you move ?
Thanks,
12/17/2018 at 6:18 PM #87319Well, my intentions were to write a very simple strategy, no Fibonacci and without any other indicator but I was not able to do it because of the PRT API. That happened almost one year ago. Honestly I don’t know if something changed in PRT since then. I don’t know if it’s possible to code your strategy now. I remember that PRT was evolving so maybe it is possible. I’m sure that @Nicolas can tell us something more.
1 user thanked author for this post.
12/18/2018 at 9:11 AM #87341Thank you @Rorschack for the update.
Without arrays, I made this version: https://www.prorealcode.com/topic/swing-lines-indicator/#post-34383 that store the last 10 support lines. I’m almost sure I coded the complete one with resistance too, it must be somewhere in the forum..
1 user thanked author for this post.
12/21/2018 at 10:52 PM #87581Hi Nicolas,
It is here and thank you for this piece of code;
https://www.prorealcode.com/prorealtime-indicators/dynamic-support-resistance-intraday/
I am really trying to code this strategy from above (https://www.prorealcode.com/topic/swing-lines-strategy/#post-87303) but I struggle to understand the subtilities of the code i.e
- I don’t get though why the variables “lastsupport” and “lastresistance” are lagging while the hereunder variables are not
12resistance = highest[n](high)resistance[n-lookback]
- what is the use of this indicator
1linear = (resistance[1] + linear) / 2and why should we devide the former resistance by 2 if
1resistance[n-lookback] = resistance[1]- what should I change to use for a swing trading on a 4hours basis considering maxbars => only shifting maxbars to barindex ?
123456789101112131415maxbars=intradaybarindex...while i <> maxbars doif newlinear[i] = 0 thenbreakendifcond = (newlinear[i] <= valsup and newlinear[i] >= valinf) or (newlineas[i] <= valsup and newlineas[i] >= valinf)if cond thennewlinearr = (newlinear[i] + newlinear)/2endifi = i+1wend
Thanks a lot for your help as even the great courses your created on coding did not enlighten this great piece of code;-)
Best,
Chris
01/07/2019 at 9:39 PM #88131Hi Nicolas,
Complementary to the hereunder question and in my willing to understand what you did i.e emprove my coding knwoledge, I don’t get why the variable “linear” gets this number (enclosed) as
- it has been given the value => 0
- the fomula writes linear = (resistance [1] + linear ) / 2
Sorry to bother you with this but I think it is important for me to understand this subtility;
I hope you agree 😉
Very best
Chris
01/08/2019 at 10:10 AM #88150The code is not mine, and I was just like you when I tried to catch all of the aspect of it at that time I modified it.
linear variable stands for resistance lines and lineas for support lines.
The code you mentioned is used to wait that the resistance or support lines have been confirmed (high high or lowest not changed since n bars). Divided the value by 2 is useful to make the code wait for the conditions to test if linear or lineas has not changed since 2 periods (at line 134 for instance).
Then when linear and lineas have changed, the code is making a test about the tolerance above and below it over a dynamic loop made of “maxbars” which is the intradaybarindex quantity. If the tolerance test is ok, an average of the found support and resistance lines is made and the line will be plot later in the code.
-
AuthorPosts
Find exclusive trading pro-tools on