Read the documentation.
bool ObjectCreate( long chart_id, // chart identifier string name, // object name ENUM_OBJECT type, // object type sub_window nwin, // window index datetime time1, // time of the first anchor point double price1, // price of the first anchor point ... datetime timeN=0, // time of the N-th anchor point double priceN=0, // price of the N-th anchor point ... datetime time30=0, // time of the 30th anchor point double price30=0 // price of the 30th anchor point );
Hi All,
I'm using the boilerplate code to create Horizontal line without any trouble in the main chart (snippet below), but can't figure out how to get them to draw in the RSI window. I assume it has to do with Chart ID, but I can't figure out how to find the Chart ID of the RSI window.
Any help would be greatly appreciated.
string symbol="YourSymbol"; string period="YourSymbolPeriod"; long a=ChartOpen(symbol,period); if(!ObjectCreate(a,"name",OBJ_HLINE,0,0,MarketInfo(symbol,MODE_ASK))) { Print(__FUNCTION__, ": failed to create a horizontal line! Error code = ",GetLastError()); ; }
Goodluck!!!!
-
Perhaps you should read the manual; nothing to do with Chart ID. ChartWindowFind - Chart Operations - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
How To Ask Questions The Smart Way. (2004)
How To Interpret Answers.
RTFM and STFW: How To Tell You've Seriously Screwed Up. -
if(!ObjectCreate(chart_ID,name,OBJ_HLINE,0,0,price))
Now that you know how, the question is why? The RSI window is always in the range [0 … 100]. A price (1.23450±) will be a straight line at the bottom. Useless.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi All,
I'm using the boilerplate code to create Horizontal line without any trouble in the main chart (snippet below), but can't figure out how to get them to draw in the RSI window. I assume it has to do with Chart ID, but I can't figure out how to find the Chart ID of the RSI window.
Any help would be greatly appreciated.