Raphael Tunji
Raphael Tunji

Reputation: 138

What is the MQL4 code to create an object like rectangle on main chart?

There is no point beating around the bush. Sincerely, am still learning coding in MQL4. My problem is that I want to have an MQL4 template that displays rectangle on chart. I want to add some code for it to display specific color, depending on price dynamics.

Upvotes: 0

Views: 1172

Answers (1)

user3666197
user3666197

Reputation: 1

Use Metatrader Editor, there you type a code ( alike this below ) and may use both the context-help, shown as you type and also the installed MQL4-Documentation, to read all further details and debug the target application use.

ObjectCreate( windowID,
              anObjectNAME,
              OBJ_RECTANGLE,
              subWindowID,
              aTime1,
              aPrice1,
              aTime2,
              aPrice2
              );

ObjectSet(    windowID,
              anObjectNAME,
              OBJPROP_COLOR,
              clrAsYouWouldLikeToHAVE
              );

Upvotes: 1

Related Questions