This makes no sense . . . .
for(i=0; i < close; i++)
i starts at 0, and the loop executes while i < Bid . . . for each iteration i is incremented . . .
Hi
Ok maybe something like this:
for(i=pivot[27]; i < close; i++) //pivot[27] being the lowest possible pivot line and the search upwards in price to find the nearest pivot line to the current price?
Or is this still wrong? :/
Thank you
Antony
Hi
Ok maybe something like this:
Or is this still wrong? :/
Ok you mean something like this then:
int i; while(pivot[i]<close){ i++; currentpivot = pivot[i]; }
Sorry if I sound a bit stupid but I am a novice coder :/
Thank you
Antony
Ok you mean something like this then:
Sorry if I sound a bit stupid but I am a novice coder :/
Hi
Just another question, this code works well for finding the nearest pivot below the current price:
int i; while(Bid>pivot[i]){ i++; currentpivot = pivot[i]; } }
If I want to search for pivot above the current price it doesn't seem to work, I have tried this:
while(Bid<pivot[i]){
i--;
currentpivot = pivot[i];
}
}
But it just wont work, any pointers?
Thank you
Antony
Basically, I have set it up so
R3 = pivot[1]
R2 = pivot[2]
R1=pivot[3]
pivotpoint=pivot[4]
S1=pivot[5]
S2=pivot[6]
S3=pivot[7]
So i am trying to find where the current price falls between whihc pivots.
Antony
#define INF 0x6FFFFFFF // Not quite infinite, Jul 2029, or 1,879,048,191 double pivot[9]; pivot[8] = INF; pivot[7] = R3; pivot[6] = R2; pivot[5] = R1; pivot[4] = pivotpoint; pivot[3] = S3; pivot[2] = S2; pivot[1] = S1; pivot[0] = 0; for (iPivot = 1; Bid > pivot[iPivot]; iPivot++){} belowPivot = pivot[iPivot-1]; abovePivot = pivot[iPivot];
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi
To search via time or bar numbers I use this for example:
I am trying the use the same type of code against price, to search for the nearest pivot line to the current price but I cant seem to get it to work, here is the code is was using to search for pivot lines below the Bid price:
Can anyone see what I am doing wrong?
Thank you
Antony