Good afternoon,
Please, let me introduce my self, I am new in this world, and I am learning as much I can…
But, I don’t understand how works proscreener search engine.
Perhaps is because I came from another kind of programming,
I was trying to study another screeners before to create my own screeners.
I am using free proreal time V11 with values at end of day( soon I will update to realtime…)
My doubts:
Doubt 1:
For example, I use one indicator that shows last zigzag value, I see that returned value matches with chart (image001.jpg)
ZIG= ZigZag[4](close)
zig1=zig[0]
return zig1
But, same instruction in proscreener has different return(image002.jpg), why??
if valle0=0 and zig1V[last]<zig2V[actual] then//-- actual candle higher than previous, increasing ramp
zigV0= zig1V[0]//zig2V[actual]//--store value in tag
valle0=1//--avoid to enter again in this loop
endif
This hasn’t a lot of sense, I know,.. i just to understand the program..
In fact , the returned value is not matching with any peak or valley (image003.jpg); i added a line for better visualization.
doubt 2:
Why I see in some screeners at the tag declaration the use of “once” instruction?? Does it means that the code is not executed only one time?
What the the rules for code execution?
Normally, in another worlds, to execute several times, it is used loops, FOR; WHILE….
All of this become because I have created a screener(image004.jpg), but it hasn’t the expected behaviour:
What I want to do with this code:
-Call zigzag function and detect changing trend(peak/valley), but only a number of periods before (with tag); not from very begining.
-Store values of peaks and valleys in different tags…
-Show results with recent peaks and valleys
TIMEFRAME(daily)
once last=50
once actual=49
once pico0=0
once valle0=0
once zigv0=0 //-- zigzag value of the valley
once zigp0=0 //--zigzag value of the peal
zig1V=ZigZag[4](close) //-- previous candle
zig2V=ZigZag[4](close) //--actual candle
//zig1=zig1V[last]
// zig2=zig2V[last2]
if valle0=0 and zig1V[last]<zig2V[actual] then//-- actual candle higher than previous, increasing ramp
zigV0= close[actual]//zig2V[actual]//--store close value of the change in tag
valle0=1//--avoid to enter again in this loop
endif
if (valle0=1 and pico0=0) and zig2V[actual]<zig1V[last] then//-- actual candle lower than previous, decreasing ramp
zigP0=zig2V[actual]//--store close value of the change in tag
pico0=1//---avoid to enter again in this loop
endif
//-- are necessary next sentences??
if last>2 then //-- assure that there are not negative values that could generate error
last =last-1
endif
if last2>2 then//-- -- assure that there are not negative values that could generate error
last2=last2-1
endif
c1= (pico0=1 and zigP0<>0)//-- was at least one peak
c2= (valle0=1 and zigV0<>0)//-- was at leat on valley
screener[(c1 and c2) ](zigv0) //--return value to order values,
//--just to double check in the chart that stored values
//are matching with the expected values
-tags LAST and ACTUAL are discounted automatically? do I need to decrease manually?
If I not decrease them, comparision will be done with same values?
I don’t know If I was really clear with my doubts…. (I tried believe me.. 🙂 )
Thanks in advance for help…