- Please post code as code by either Alt+s or the code button </>
- Here is a list of all functions with explanation so one can search for keywords: https://www.mql5.com/en/docs/function_indices
- There look for iCustom and study the example ...
- www.mql5.com
Then please edit and fix your post first, as requested. If you put in the effort then users will be more willing to read your code and answer you. If you don't then you will tend to be ignored.
Please edit your post (don't create a new post) and replace your code properly (with "</>" or Alt-S), or attach the original file directly with the "+ Attach file" button below the text box.
-
You have now been asked three times. You completely ignored the first. Please edit your (original) post and use the CODE button (or Alt+S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum (2019)
Messages Editor -
Perhaps you should read the manual, especially the examples.
How To Ask Questions The Smart Way. (2004)
How To Interpret Answers.
RTFM and STFW: How To Tell You've Seriously Screwed Up.They all (including iCustom) return a handle (an int). You get that in OnInit. In OnTick/OnCalculate (after the indicator has updated its buffers), you use the handle, shift and count to get the data.
Technical Indicators - Reference on algorithmic/automated trading language for MetaTrader 5
Timeseries and Indicators Access / CopyBuffer - Reference on algorithmic/automated trading language for MetaTrader 5
How to start with MQL5 - General - MQL5 programming forum - Page 3 #22 (2020)
How to start with MQL5 - MetaTrader 5 - General - MQL5 programming forum - Page 7 #61 (2020)
MQL5 for Newbies: Guide to Using Technical Indicators in Expert Advisors - MQL5 Articles (2010)
How to call indicators in MQL5 - MQL5 Articles (2010)
Hello friends:
Thanks for your valuable guidances.
Now here I am writing the code with the mentioned command. I have attached a indicator file also. Thanks a lot in advance.
double SellBuffer[]; double BuyBuffer[]; int SS = iCustom(_Symbol,_Period,"SUPER SIGNALS",24,INDICATOR_DATA); ArraySetAsSeries(SellBuffer,true); ArraySetAsSeries(BuyBuffer,true); CopyBuffer(SS,0,0,3,SellBuffer); CopyBuffer(SS,1,0,3,BuyBuffer); double SSsell0 = SellBuffer[0]; double SSbuy0 = BuyBuffer[0]; double SSsell1 = SellBuffer[1]; double SSbuy1 = BuyBuffer[1];
Hello friends:
Thanks for your valuable guidances.
Now here I am writing the code with the mentioned command. I have attached a indicator file also. Thanks a lot in advance.Hello
Hello Mr.William Roeder: Thanks.
As per your words I have tried and attached an indicator file. If you can help me. Regards.
You have provided source file of the indicator but not the complete code of your EA.
Your code sample shown is either incorrect or incomplete, because obtaining the indicator handle should be in the OnInit() event handler and the CopyBuffer part should be in the OnTick() event handler. They should not be together.
So, to better understand how you actually implemented it, you need to show more of your code.
You have provided source file of the indicator but not the complete code of your EA.
Your code sample shown is either incorrect or incomplete, because obtaining the indicator handle should be in the OnInit() event handler and the CopyBuffer part should be in the OnTick() event handler. They should not be together.
So, to better understand how you actually implemented it, you need to show more of your code.
Hello Mr.Fernando C..... thanks for your reply and helping mind.
I am copy pasting below my EA codes to get the buffer details.
int OnInit() { // int BOLL = iCustom(_Symbol,_Period,"BB",50,0,2,PRICE_MEDIAN); int SS = iCustom(_Symbol,_Period,"SUPER SIGNALS",24,INDICATOR_DATA); return(INIT_SUCCEEDED); } void OnDeinit(const int reason) { //--- }void OnTick() { double Ask = NormalizeDouble(SymbolInfoDouble(_Symbol,SYMBOL_ASK),_Digits); double Bid = NormalizeDouble(SymbolInfoDouble(_Symbol,SYMBOL_BID),_Digits); MqlRates Priceinfo[]; ArraySetAsSeries(Priceinfo,true); int Pricedata = CopyRates(Symbol(),PERIOD_CURRENT,0,3,Priceinfo); int nBars=Bars(Symbol(),PERIOD_CURRENT); // if(m_nLastBars!=nBars){m_nLastBars=nBars;m_bNewBar=true;} if(prebar!=nBars){prebar=nBars;newbar=true;} else {newbar=false;} if (newbar == true ) { double SellBuffer[]; double BuyBuffer[]; int SS = iCustom(_Symbol,_Period,"SUPER SIGNALS",24,INDICATOR_DATA); ArraySetAsSeries(SellBuffer,true); ArraySetAsSeries(BuyBuffer,true); CopyBuffer(SS,0,0,3,SellBuffer); CopyBuffer(SS,1,0,3,BuyBuffer); double SSsell0 = SellBuffer[0]; double SSbuy0 = BuyBuffer[0]; double SSsell1 = SellBuffer[1]; double SSbuy1 = BuyBuffer[1];When I write the SSsell0, SSbuy0, SSsell1 and SSbuy1 to the .csv file it shows only zeros....
Your code is still invalid (and messy). You are still reading the indicator handle just before the CopyBuffer.
You also read the handle in OnInit() and then discard it (it's a local variable). Why? Was that just for show?
And you also have not shown any CSV file functionality or what is output.
So, I will repeat this for the last time and if you are unable or unwilling to do it, I will just ignore it:
- Please provide proper code that will compile and can be tested and that shows the functionality for the issue.
- You don't have to provide your full EA. Just create an example code to show the issue, but it must compile and run to demonstrate the problem.
Your code is still invalid (and messy). You are still reading the indicator handle just before the CopyBuffer.
You also read the handle in OnInit() and then discard it (it's a local variable). Why? Was that just for show?
And you also have not shown any CSV file functionality or what is output.
So, I will repeat this for the last time and if you are unable or unwilling to do it, I will just ignore it:
- Please provide proper code that will compile and can be tested and that shows the functionality for the issue.
- You don't have to provide your full EA. Just create an example code to show the issue, but it must compile and run to demonstrate the problem.
Thanks a lot Mr.Fernando Carreiro for your valuable help guidance.
As per your instuctions I attaching a sample EA file also here now. Please check it and correct me to get the
required buffer details. In tester visual mode all details are coming. Only in the .csv file I am not getting.
Thanks and Regards.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello Sir
I am trying to get the indicator bufffer details to my EA, but I am unable to get it, why?
In the strategy tester visual screen all details are available but in the EA file I am not getting.
The Super signal indicator code is as follows:
<Incorrectly posted code deleted>
In my EA I am trying mql5 code as follows:
<Incorrectly posted code deleted>
Why I am not getting the buffer details in my EA?
Can anyone help me to get the buffer details please.......Thanks in advance and best regards
rd balasingh..