-
Use the debugger or print out your variables, including _LastError and prices and find out why. Do you really expect us to debug your code for you?
Tracing, Debugging and Structural Analysis of Source Code - MQL5 Articles (2011)
Introduction to MQL5: How to write simple Expert Advisor and Custom Indicator - MQL5 Articles (2010) -
Always post all relevant code (using Code button) or attach the source file. We have no idea what your arrays types are, their indexing direction, how you filled them, nor your indicator, and your call.
How To Ask Questions The Smart Way. (2004)
Be precise and informative about your problem
-
Use the debugger or print out your variables, including _LastError and prices and find out why. Do you really expect us to debug your code for you?
Tracing, Debugging and Structural Analysis of Source Code - MQL5 Articles (2011)
Introduction to MQL5: How to write simple Expert Advisor and Custom Indicator - MQL5 Articles (2010) -
Always post all relevant code (using Code button) or attach the source file. We have no idea what your arrays types are, their indexing direction, how you filled them, nor your indicator, and your call.
How To Ask Questions The Smart Way. (2004)
Be precise and informative about your problem
MqlRates rates[]; double last=0; ArraySetAsSeries(rates,true); int start_pos_r=0,count_r=3; CopyRates(m_symbol.Name(),my_timeframe,start_pos_r,count_r,rates);
double array_st[]; ArraySetAsSeries(array_st,true); int start_pos_st=0,count_st=3; if(!iGetArrayST(handle_iST,0,start_pos_st,count_st,array_st)) return;
handle_iST=iCustom(_Symbol,PERIOD_CURRENT,"supertrend_");
//+------------------------------------------------------------------+ bool iGetArrayST(const int handleST,const int bufferST,const int start_posST, const int countST,double &arr_bufferST[]) { bool resultST=true; if(!ArrayIsDynamic(arr_bufferST)) { //if(InpPrintLog) PrintFormat("ERROR! EA: %s, FUNCTION: %s, this a no dynamic array!",__FILE__,__FUNCTION__); return(false); } ArrayFree(arr_bufferST); //--- reset error code ResetLastError(); //--- fill a part of the iBands array with values from the indicator buffer int copiedST=CopyBuffer(handleST,bufferST,start_posST,countST,arr_bufferST); if(copiedST!=countST) { //--- if the copying fails, tell the error code //if(InpPrintLog) PrintFormat("ERROR! EA: %s, FUNCTION: %s, amount to copy: %d, copied: %d, error code %d", __FILE__,__FUNCTION__,countST,copiedST,GetLastError()); //--- quit with zero result - it means that the indicator is considered as not calculated return(false); } return(resultST); }no errors ...
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
This happens:
when I have this:
what is rates doing, and why is selling opening?
array_st is the array of the custom indicator.