Download MetaTrader 5

How to read values from custom indicator while indicator doesn't use buffers?

To add comments, please log in or register
Use MQL5 Cloud Network. It is secure!
Sherif Hasan
7290
Sherif Hasan 2013.12.03 20:13 

How to read values from custom indicator while indicator doesn't use buffers?

I am writing new ea which by using custom indicator.but indicator not using buffers. so how can i read values for ea?

Plesse give me a suggetions to solve this issues.

Alain Verleyen
Moderator
30752
Alain Verleyen 2013.12.03 20:39  
sheriffonline:

How to read values from custom indicator while indicator doesn't use buffers?

I am writing new ea which by using custom indicator.but indicator not using buffers. so how can i read values for ea?

Plesse give me a suggetions to solve this issues.

What are using the indicator ? Objects ? Then read values directly from objects.

Or ?

Sherif Hasan
7290
Sherif Hasan 2013.12.06 05:03  
Is there any example code to read values from objects? please support!
Ubzen
5394
Ubzen 2013.12.06 05:32  
sheriffonline:
Is there any example code to read values from objects? please support!

https://docs.mql4.com/objects.

Search for the object just like you search for orders. Then use ObjectGet() to retrieve values. Read the documentation above for other helpful functions. Example.

for(int i=ObjectsTotal()-1; i>=0; i--){
    name=ObjectName(i);
    if(ObjectType(name) != OBJ_HLINE) continue;
    x=ObjectGet(name, OBJPROP_PRICE1);
    return(x);
}
Carl Schreiber
6609
Carl Schreiber 2013.12.06 07:32  

you can use: - GlobalVariables, -Files, -namedPipes, -DLL, (DDE 'knows' only one way I think: from MT4 to e.g. EXCEL)

Gooly

To add comments, please log in or register