There are two types of arrows.
- Objects. you need to figure out the naming convention, find the arrow, and check its time and arrow code.
- Arrow buffers you read with iCustom. Are there values in the data folder?
There are two types of arrows.
- Objects. you need to figure out the naming convention, find the arrow, and check its time and arrow
code.
- Arrow buffers you read with iCustom. Are there values in the data folder?
int handle = iCustom(NULL,0,"wprsisignal", PRICE_CLOSE // using the close prices );
it returns some numbers. Can you please tell me what parameters should I give to the iCustom() to return Plot arrow values.
Also
there is another problem some indicators have multiple buffers for drawing arrows what happens in this case to the iCustom() ?
I know I am asking too much, but my brain has blown up already, please help. :D
You read buffers with iCustom handle. One buffer for each Wingding to show. If the buffer is EMPTY_VALUE (possibly zero) there is no arrow.
my code looks like this right now, should it prin 233 if arrow appears in indicator ?
EA it returns 10 iin "handle" vriable:
int OnInit() { return(INIT_SUCCEEDED); } void OnTick() { int handle=iCustom(NULL,0,"event", PRICE_CLOSE // using the close prices ); Print(handle); IndicatorRelease(handle); }
And Inidicator code:
//+------------------------------------------------------------------+ //| event.mq5 | //| Copyright 2020, MetaQuotes Software Corp. | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2020, MetaQuotes Software Corp." #property link "https://www.mql5.com" #property version "1.00" #property indicator_chart_window #property indicator_buffers 1 #property indicator_plots 1 #property indicator_label1 "MA" #property indicator_type1 DRAW_ARROW #property indicator_color1 clrYellow #property indicator_style1 STYLE_SOLID #property indicator_width1 1 int counter = 0; double buffer[]; int OnInit(){ ArraySetAsSeries(buffer,true); SetIndexBuffer(0,buffer); PlotIndexSetInteger(0,PLOT_ARROW,233); IndicatorSetString(INDICATOR_SHORTNAME,"MA("+IntegerToString(_Period)+")"); return(INIT_SUCCEEDED); } int OnCalculate(const int rates_total,const int prev_calculated,const datetime &time[],const double &open[],const double &high[], const double &low[],const double &close[],const long &tick_volume[],const long &volume[],const int &spread[]){ for(int i=30;i>=0;i--) { buffer[i]=iHigh(_Symbol,_Period,i); } return(rates_total); } /* void OnChartEvent(const int id,const long& lparam,const double& dparam,const string& sparam) { counter+=1; Print(IntegerToString(counter)+"some: ", IntegerToString(id)); } */
EA it returns 10 iin "handle" vriable:
- You read the buffer. Your buffer contains the candle high. Why do you think you would read 233?
- Perhaps you should read the manual, especially the examples. They all (including iCustom) return a
handle (an int.) You get that in OnInit. In OnTick 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 5Creating an iMA indicator handle, getting indicator values.
How to start with MQL5 - General - MQL5 programming forum - Page 3 #22 2020.03.08Also see my example for encapsulating calls
Detailed explanation of iCustom - MQL4 programming forum
Perhaps you should read the manual.
- You read the buffer. Your buffer contains the candle high. Why do you think you would read 233?
- Perhaps you should read the manual, especially the examples. They all (including iCustom)
return a handle (an int.) You get that in OnInit. In OnTick 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 5Creating an iMA indicator handle, getting indicator values.
How to start with MQL5 - General - MQL5 programming forum - Page 3 #22 2020.03.08Also see my example for encapsulating calls
Detailed explanation of iCustom - MQL4 programming forum
Last one question, what I am trying to do is to detect those arrows from EA I see how it is possible from iCustom, But my goal is to this EA should work for any inidicator I would give it without knowing the indicators code by myself, do you think I can get there ? or it is impossible ?
Yeah I understood you need to use CopyBuffer with this indicator handle to copy buffer from indicator to some variable,
Last one question, what I am trying to do is to detect those arrows from EA I see how it is possible from iCustom, But my goal is to this EA should work for any inidicator I would give it without knowing the indicators code by myself, do you think I can get there ? or it is impossible ?
Hi, campire,
I'm in the same situation, did you manage to find the necessary code?
Here are all object function listed: https://www.mql5.com/en/docs/objects.
Loop through all object (=ObjectsTotal()), get the name of the actual one in the list with ObjectName() and now you can find the object with ObjectFind().
- www.mql5.com
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
on more thing I can't edit indicators code it just prints it, so main complication is that I am only able to create expert advisor I can't touch to indicator.
I would really appreciate any suggestions or thoughts about this,
thank you in advance