I want to keep saving a value for Zigzag indicator and save it as a buffer
Makes no sense
- “A value” is one value. “A buffer” is an array of values.
- Only indicators have buffers.
- Why would you save in a buffer? You would be showing the same as Zigzag.
William Roeder #:
Makes no sense
- “A value” is one value. “A buffer” is an array of values.
- Only indicators have buffers.
- Why would you save in a buffer? You would be showing the same as Zigzag.
I am still learning
I want to save these values from zigzag and i don't want it to be changed unless some conditions are not being achieved
Files:
I have already get them from this Code
double arr[6]={0.0,0.0,0.0,0.0,0.0,0.0}; for (int i = 0;i<1000;i++) { double ZigZag = iCustom(_Symbol,PERIOD_CURRENT,"ZigZag",0,i); if(ZigZag != EMPTY_VALUE && ZigZag != 0) { if (arr[0] == 0.0) { arr[0]=ZigZag; } else if (arr[1] == 0.0) { arr[1] = ZigZag; } else if (arr[2] == 0.0) { arr[2] = ZigZag; } else if (arr[3] == 0.0) { arr[3] = ZigZag; } else if (arr[4] == 0.0) { arr[4] = ZigZag; } else if (arr[5] == 0.0) { arr[5] = ZigZag; break; } } }
Your code | double arr[6]={0.0,0.0,0.0,0.0,0.0,0.0}; for (int i = 0;i<1000;i++) { double ZigZag = iCustom(_Symbol,PERIOD_CURRENT,"ZigZag",0,i); if(ZigZag != EMPTY_VALUE && ZigZag != 0) { if (arr[0] == 0.0) { arr[0]=ZigZag; } else if (arr[1] == 0.0) { arr[1] = ZigZag; ⋮ |
Simplified | double arr[6]; int count=0; for (int i = 0;i<1000 && count < 6;++i){ double ZigZag = iCustom(_Symbol,PERIOD_CURRENT,"ZigZag",0,i); if(ZigZag != EMPTY_VALUE && ZigZag != 0){ arr[count++]=ZigZag; } |
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