Errors, bugs, questions - page 276 1...269270271272273274275276277278279280281282283...3193 New comment lVlaxim 2011.01.21 23:11 #2751 Yedelkin: Check out the MQL5 Reference Guide / Technical Indicators / iCustom Thank you very much for your promptness) vda 2011.01.21 23:32 #2752 On topic. I almost got it, but COUNTER does not start in the terminal log saysremovedloaded successfully it worked!!! Sergey Gritsay 2011.01.22 00:06 #2753 you have an error here. v161_handle=iCustom(NULL,0,"ErolМТ5"); v162_handle=iCustom(NULL,0,"ErolМТ5"); Sum_handle=iCustom(NULL,0,"ErolМТ5"); In this case, all three variables will have the same handle. as you are calling the same indicator three times. vda 2011.01.22 00:13 #2754 sergey1294: you have an error here In this case, all three variables will have the same handle, because you are calling the same indicator three times.Yes, but as I understand it, the values of the index lines of the indicator (the values of the 3 lines)we get through:CopyBuffer(v161_handle,1,0,3,Spr1Buffer) CopyBuffer(v162_handle,2,0,3,Spr2Buffer) CopyBuffer(Sum_handle,4,0,3,SumBuffer) here 1, 2 and 4 are the index values of the indicator lines, which are stored in the buffer,which we then compare with each other.But that's not a problem, it doesn't calculate correctly with these indicator line indices Документация по MQL5: Стандартные константы, перечисления и структуры / Константы индикаторов / Линии индикаторов www.mql5.com Стандартные константы, перечисления и структуры / Константы индикаторов / Линии индикаторов - Документация по MQL5 10$ for upgrading the Reading indicator buffers set Any rookie question, so vda 2011.01.22 00:15 #2755 Any advice on where to go or what to do here?void OnTick() { ArraySetAsSeries(Spr1Buffer,true); ArraySetAsSeries(Spr2Buffer,true); ArraySetAsSeries(SumBuffer,true); if(CopyBuffer(v161_handle,1,0,3,Spr1Buffer)<0 || CopyBuffer(v162_handle,2,0,3,Spr2Buffer)<0 || CopyBuffer(Sum_handle,4,0,3,SumBuffer)<0) { Alert("Ошибка копирования буферов индикатора номер ошибки:",GetLastError()); } bool SellSpr1 =(Spr1Buffer[1] > Spr2Buffer[1]); bool SellSum1 =(SumBuffer[1]>=Sp); if(SellSpr1 && SellSum1 && !PositionSelect(_Symbol)) { PositionOpenSell1(); } bool BuySpr1 =(Spr1Buffer[1] < Spr2Buffer[1]); bool BuySum1 =(SumBuffer[1]>=Sp); if(BuySpr1 && BuySum1 && !PositionSelect(_Symbol)) { PositionOpenBuy1(); } Sergey Gritsay 2011.01.22 00:15 #2756 alexluek: Yes, but as I understand it, the values of the index lines of the indicator (the values of the 3 lines)we get through:here 1, 2 and 4 are the index values of the indicator lines, which are stored in the buffer,which we then compare to each other.But it's not a problem, it doesn't calculate correctly according to these indexes of indicator lines It is sufficient to load one copy of the indicator and address the necessary buffer indexes via the copy buffer vda 2011.01.22 00:30 #2757 sergey1294: It's enough to load one copy of the indicator, and address the desired buffer index via the copybufferno it is not, I cannot get the values of the 2nd line as the values of 2 line indices stored in different buffers are compared. bool SellSpr1 =(Spr1Buffer[1] > Spr2Buffer[1]); Sergey Gritsay 2011.01.22 00:50 #2758 alexluek: Wrong, it is not possible to get the values of the 2nd line as the values of 2 line indices stored in different buffers are compared. there may be an error in the indicator itself vda 2011.01.22 01:07 #2759 sergey1294: there may be errors in the indicator itselfthe indicator reads correctly vda 2011.01.22 14:43 #2760 Saving the drowning is the job of the drowning.It may come in handy for the future:To call 2 or more indicator lines in an EA for the current barchoose 1 handle and call the indicator, then use the copybuffer to save index valuesand then work with these buffers. sergey1294 thanks for the help!int OnInit() { v161_handle=iCustom(NULL,0,"LeroyMТ5"); if(v161_handle<0) { Alert("Ошибка при создании индикаторов: ",GetLastError()); return(-1); } return(0); } void OnTick() { ArraySetAsSeries(Sp1Buffer,true); ArraySetAsSeries(Sp2Buffer,true); ArraySetAsSeries(Sp3Buffer,true); if(CopyBuffer(v161_handle,1,0,1,Sp1Buffer)<0 || CopyBuffer(v161_handle,2,0,1,Sp2Buffer)<0 || CopyBuffer(v161_handle,4,0,1,Sp3Buffer)<0) { Alert("Ошибка копирования буферов индикатора номер ошибки:",GetLastError()); return; } bool SellSpr1 =( Sp1Buffer[0]> Sp2Buffer[0] && Sp3Buffer[0]>=Sp ); if(SellSpr1 && !PositionSelect(_Symbol)) { PositionOpenSell1(); } bool BuySpr1 =( Sp1Buffer[0]< Sp2Buffer[0] && Sp3Buffer[0]>=Sp ); if(BuySpr1 && !PositionSelect(_Symbol)); { PositionOpenBuy1(); } } Questions from Beginners MQL5 what is wrong with Urgent help needed 1...269270271272273274275276277278279280281282283...3193 New comment
Check out the MQL5 Reference Guide / Technical Indicators / iCustom
Thank you very much for your promptness)
On topic. I almost got it, but COUNTER does not start in the terminal log says
removed
loaded successfully
it worked!!!you have an error here.
In this case, all three variables will have the same handle. as you are calling the same indicator three times.you have an error here
In this case, all three variables will have the same handle, because you are calling the same indicator three times.Yes, but as I understand it, the values of the index lines of the indicator (the values of the 3 lines)
we get through:
here 1, 2 and 4 are the index values of the indicator lines, which are stored in the buffer,
which we then compare with each other.
But that's not a problem, it doesn't calculate correctly with these indicator line indices
Any advice on where to go or what to do here?
Yes, but as I understand it, the values of the index lines of the indicator (the values of the 3 lines)
we get through:
here 1, 2 and 4 are the index values of the indicator lines, which are stored in the buffer,
which we then compare to each other.
But it's not a problem, it doesn't calculate correctly according to these indexes of indicator lines
It's enough to load one copy of the indicator, and address the desired buffer index via the copybuffer
no it is not, I cannot get the values of the 2nd line
as the values of 2 line indices stored in different buffers are compared.
Wrong, it is not possible to get the values of the 2nd line
as the values of 2 line indices stored in different buffers are compared.
there may be errors in the indicator itself
the indicator reads correctly
Saving the drowning is the job of the drowning.
It may come in handy for the future:
To call 2 or more indicator lines in an EA for the current bar
choose 1 handle and call the indicator, then use the copybuffer to save index values
and then work with these buffers. sergey1294 thanks for the help!