Your code shows :
pBuffer_PSY != DBL_MAX
Yeh I am trying options such as pBuffer_PSY[i] (it was a typo) != DBL_MAX or pBuffer_PSY[i] != EMPTY_VALUE.
Problem looks to be the whole array contains Zero Values, and not EMPTY_VALUES. Which is confirmed by pBuffer_PSY[i] != 0.00, than loop does not pass.
2023.09.22 21:19:14.459 iVSA (US30,H1) [US30,PERIOD_H1] CScanVSA::UpdatePreliminaryStop [2023.09.15 13:00] rates_total[36692] ArraySize[36692] Index[158] < LookBack[240] count[39] PSY[0.0] EmptyValue[158][false] 2023.09.22 21:19:14.459 iVSA (US30,H1) [US30,PERIOD_H1] CScanVSA::UpdatePreliminaryStop [2023.09.15 13:00] rates_total[36692] ArraySize[36692] Index[159] < LookBack[240] count[40] PSY[0.0] EmptyValue[159][false] 2023.09.22 21:19:14.459 iVSA (US30,H1) [US30,PERIOD_H1] CScanVSA::UpdatePreliminaryStop [2023.09.15 13:00] rates_total[36692] ArraySize[36692] Index[160] < LookBack[240] count[41] PSY[0.0] EmptyValue[160][false]
I am not sure why the array is passed in with Zero values.
I can not use CopyBuffer() as the CScanVSA itself supplies data to the indicator. iVSA include this class
#include "..\\..\\..\\Experts\\AlgoBulls\\Includes\\CScanner\\ScanVSA.mqh" CScanVSA *cScanVSA;
When I use if(pBuffer_PSY[i] != 0.00 || pBuffer_PSY[i] != EMPTY_VALUE) { } than it returns the following
2023.09.22 21:49:46.967 iVSA (US30,H1) [US30,PERIOD_H1] CScanVSA::UpdatePreliminaryStop [2023.09.15 13:00] rates_total[36693] ArraySize[36693] Index[159] < LookBack[241] count[39] PSY[0.0] EmptyValue[159][false] // if not EMPTY_VALUE than what is the value here? 2023.09.22 21:49:46.967 iVSA (US30,H1) [US30,PERIOD_H1] CScanVSA::UpdatePreliminaryStop [2023.09.15 13:00] rates_total[36693] ArraySize[36693] Index[160] < LookBack[241] count[40] PSY[0.0] EmptyValue[160][false] 2023.09.22 21:49:46.967 iVSA (US30,H1) [US30,PERIOD_H1] CScanVSA::UpdatePreliminaryStop [2023.09.15 13:00] rates_total[36693] ArraySize[36693] Index[161] < LookBack[241] count[41] PSY[0.0] EmptyValue[161][false]
I am confused a lot now !!!
How can I print correct value of pBuffer_PSY[idxN] !!!
This condition is always true, should be "and" and not "or".
Thanks @Alain Verleyen
Yeh replacing with 'and' worked out.
Now the problem is array returns 'Zero value' for all indexes, so the if condition never fulfills. :(
What could be alternate way to pass in the DataBufferArray to the Class? As this way seems having problem.
Seems I am exhausted now for almost 13 hours on screen. We try again tomorrow with fresh mind.
Update: I figured it out Alan, I was using reverse loop in the Indicator, so prior values are always zero :)
Thanks again for your direction.Thanks @Alain Verleyen
Yeh replacing with 'and' worked out.
Now the problem is array returns 'Zero value' for all indexes, so the if condition never fulfills. :(
What could be alternate way to pass in the DataBufferArray to the Class? As this way seems having problem.
Seems I am exhausted now for almost 13 hours on screen. We try again tomorrow with fresh mind.
Update: I figured it out Alan, I was using reverse loop in the Indicator, so prior values are always zero :)
Thanks again for your direction.- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Dear Fellows
I have created a custom Indicator iVSA, which uses CScanVSA.method to get DataBuffer values.
I need to lookback indicator buffers e.g. PreliminarySupply buffer to confirm BuyingClimax in CScanVSA. To achieve this I am using following Method to pass in BufferArrays to the Class.
Now the error (rather a problem) I face is that pBuffer_PSY[i] EMPTY_VALUES are not recognized in CScanVSA.
I have failed to identify the reason, why if(pBuffer_PSY[i] != DBL_MAX || pBuffer_PSY[i] != EMPTY_VALUE) { } is not able to recognize the EMPTY_VALUE in passed in buffer.
It looks pBuffer_PSY[] is having Zero value for all indexs Even on Index where it is supposed to have Bar's High value!!! Now since (0.00 != EMPTY_VALUE) it pass the if condition.
Support from members to debug the matter, is highly appreciated.
Thanks in Advance.
Regards