Both (2a, 2b) solutions do the same thing, so I need a way to reuse code (pass data to method or only range pram to script ).
3. How to get data for specified range? (ex. whole data - data from the beginning)
Look up iCustom(), designed for I/F to indicators...
1. ya... ZZ always sucks us in but beware: all that glistens not 24K. Look at M1 for a bit - notice how rightmost turn point can replot due to price retracing.
IF you take ZZ buy/sell sigs you gonna have more loss then you ever imagine.
The swings look great yes? However, from each turn point to the next at the other magically far away swing end, their will be many aborted turn points which occur in real time due to retracements.
Proof? do simple ind that plots eg, OBJ_ARROW object at each ZZ turnpoint. (use iCustom() to inspect the ZZ's high/low buffers and <>0 is going to be ZZ turn point)
This is good exercise for you and will demonstrate not only above but show you what is needed to use the system generally regards programming stuff.
2...n, Please do some self-learning, ok?
Looksee top all site pages - those links are your portals to various aspects of it all.
Use the top right search box also.
tbh, you really should learn to crawl prior messin with your 'ideas' cuz the term "can of worms" generated from poor foundations etc, springs to mind...