William Roeder #:
-
Please post only in English on this part of the forums. Use the automatic translation tool if needed. Use simple language structure when using mechanical translation. (2013)
Or use the Français forum.
-
Where is the rest of your function?
How To Ask Questions The Smart Way. (2004)
Be precise and informative about your problemAlways post all relevant code (using Code button) or attach the source file.
Sorry,
I update, in the main topic.
Regards.
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
Good morning,
There is an error that I don't understand. Maybe I'm doing it wrong.
I would like to have an indicator that returns me ADX values in a larger unit of time.
when I want to use indicatorTempo, it returns 0...
int TrendDetector(int _shift) { int trend_direction=0; double ADXBuffer[1]; double PlusDIBuffer[1]; double MinusDIBuffer[1]; // Copy ADX indicator values to buffers: /* CopyBuffer(indicator_handle,0,_shift,1,ADXBuffer); CopyBuffer(indicator_handle,1,_shift,1,PlusDIBuffer); CopyBuffer(indicator_handle,2,_shift,1,MinusDIBuffer); */ datetime timeArray[]; CopyTime(_Symbol,PERIOD_CURRENT,_shift,1,timeArray); int maPosition = iBarShift(_Symbol,HTF,timeArray[0],false); // je récupere la date et heure -> variable maPosition : Ok // je veux ensuite récuperer l'état de l'indicateur à la période HTF pour la date donnée ? CopyBuffer(indicator_Tempo,0,maPosition,1,ADXBuffer); CopyBuffer(indicator_Tempo,1,maPosition,1,PlusDIBuffer); CopyBuffer(indicator_Tempo,2,maPosition,1,MinusDIBuffer); // If ADX value is considered (trend strength): if(ADXTrendLevel>0) { if(ADXBuffer[0]<ADXTrendLevel) { return(trend_direction); } } // Check +DI and -DI positions relative to each other: if(PlusDIBuffer[0]>MinusDIBuffer[0]) { trend_direction=1; } else if(PlusDIBuffer[0]<MinusDIBuffer[0]) { trend_direction=-1; } return(trend_direction); }Here ADXBuffer[0] = 0 ...
I don't understand my mistake... Can you help me?
Thanks in advance.