MQL4 - automated forex trading   /  

Forum

I am coding an indicator. How dow I write a text string at a specified position in the chart window(window 0)?????

Back to topics list To post a new topic, please log in or register

avatar
2
tcahill514 2006.06.25 00:02 
Hi folks,

As you can see I have created an Object "Close". I have used ObjectSetText() to output the ema price to the Main Chart Window (Win 0). This works except that I actually have 3 ema's, w/objects, and the 3 text strings/price over lap each other. I would really like to have the text/ema price to be printed on the main chart price bar/y-axis.

dCloseBuff[nCnt]= iMA(NULL,0,EMAPeriod,0,MODE_EMA,PRICE_CLOSE,nCnt);
bRetVal = ObjectCreate("Close", OBJ_TEXT, 0, Time[0], dCloseBuff[0]);
ObjectSetText("Close", DoubleToStr(dCloseBuff[0], Digits), 10, "Times New Roman", White);

I have tried to use:
// ObjectSet("Close", OBJPROP_YDISTANCE, 50);
//OBJPROP_YDISTANCE
//OBJPROP_XDISTANCE

but this has no effect.

Any help would be greatly appreciated,
TC

Expert Advisors Based on Popular Trading Systems and Alchemy of Trading Robot Optimization

Expert Advisors Based on Popular Trading Systems and Alchemy of Trading Robot Optimization

This article dwells on implementation algorithm of simplest trading systems. The article will be useful for beginning traders and EA writers.


avatar
2
mstanic 2006.06.27 10:37 
You can't have 3 text objects with same name.
Try use GetLastError if bRetVal is false;
Back to topics list  

To add comments, please log in or register