[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 720
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I see you're already coming to a decision yourself
Maybe it's the heat that makes my brain melt.)
I am approaching the solution... It's like a dog: I understand what I understand, but I can't say it, i.e. I can't represent it in the code.)
Maybe it's the heat that makes my brain melt.)
How do you search for fractals?
I look for fractals using the ZIGZAG-FRACTALS indicator with this function:
Now I have added to the lines: if(ZZCur == High[i] && UpCount < 2) and if(ZZCur == Low[i] && DnCount < 2) checking for the next fractal higher or lower than the first one found.
We have the following lines
if(ZZCur == High[i] && ZZCur > ZZFirst && UpCount < 2) and
if(ZZCur == Low[i] && ZZCur < ZZFirst && DnCount < 2)
But in the end the search is somehow inadequate :(
In the picture a thick white line shows how it should be and a thin green line shows how it is done...
I search for fractals using the ZIGZAG-FRACTALS indicator with this function:
Try searching with this function:
This function returns the bar number of the fractal. First you call it with parameter nf = 0 - the last fractal will be found, and then you call this function in the loop, where nf = cycle counter from 1 to ... as long as necessary. In the loop body, check if the next found fractal matches the criteria you need and if it does, exit the loop. After the analysis you will have the bar numbers of two fractals you need and do with them what you want.
Try searching with this function:
The function returns the bar number of the fractal. First you call it with parameter nf = 0 - the last fractal will be found, and then you call this function in the loop, where nf = cycle counter from 1 to ... as long as necessary. In the loop body, check if the next found fractal matches the criteria you need and if it does, exit the loop. After the analysis you will have the bar numbers of two fractals you need and do with them what you want.
In the tester or on the demo?
In the tester the point on the other instruments will be 0
It was in the tester,... I have not got any information about it, but I'm sure it will be useful for me. So, as a result, I made a lot of trouble with my trawl code and took KimIV's trawl pairs monitoring function. Now everything works on demo ))
Thanks for your help everyone, your explanations are very helpful.
Seems to have solved the problem, but the question remains...
How do I deinitialise a variable for reuse?
You can't, when you initialize a variable, it just allocates an area of RAM, so why reassign it? Just reset the variable to zero, and use it as many times as you like. As a matter of fact, what's the problem? Why deinitialise a variable? It just doesn't make sense.
Why deinitialise a variable?
The condition if
here we do something
otherwise if another condition
do something else.
The point is not to multiply variables, lots of conditions and counters.