I am coding an indicator. How dow I write a text string at a specified position in the chart window(window 0)?????
You can't have 3 text objects with same name.
Try use GetLastError if bRetVal is false;
Try use GetLastError if bRetVal is false;
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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