c3po: should I use an operator loop to check each bar back to find the last signal? assign the signal to a global variable and then break the loop and use that global variable as my "last signal"?
| No need for the global variableint iLastSig=0; for(; iLastSig < Bars; iLastSig++) if( iCustom(..., iLastSig) != EMPTY_VALUE) break; Print("last signal on bar "+iLastSig); |
thanks WHRoeder. You are great!
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
Hi, I am a new programmer. I have read the book and documentation. I have been searching my question on icustom.
How can i find the last signal produced by my custom indicator without knowing how many bars back the last one appeared?
The indicator paints a line, and may not have painted again since some number of bars back, so i cant put in a shift of "1" or "2" in icustom, because the last line draw could be any number of bars back.
should I use an operator loop to check each bar back to find the last signal? assign the signal to a global variable and then break the loop and use that global variable as my "last signal"?
Thank you.