Pls disregard - I have investigated in documentation already and the proper code printing current values on the screen seems to be:
Comment("sqh: ", sqh[0], "\n", "sql: ", sql[0], "\n", "stdh: ", stdh[0], "\n", "stdl: ", stdl[0]);
Pls disregard - I have investigated in documentation already and the proper code printing current values on the screen seems to be:
Comment("sqh: ", sqh[0], "\n", "sql: ", sql[0], "\n", "stdh: ", stdh[0], "\n", "stdl: ", stdl[0]);
Now I have stuck with iCustom() function.
When I pull COG (Center Of Gravity) values on the terminal right from the indicator using code above, all is working well.
But when I try to call these values from an EA using the iCustom() - I see nothing.
Since all buffers are defined in COG:
int init()
{
IndicatorShortName("Center of Gravity#2");
SetIndexStyle(0, DRAW_LINE);
SetIndexBuffer(0, fx);
SetIndexBuffer(1, sqh);
SetIndexBuffer(2, sql);
SetIndexBuffer(3, stdh);
SetIndexBuffer(4, stdl);
p = MathRound(bars_back);
nn = m + 1;
ObjectCreate("pr" + sName, 22, 0, Time[p], fx[p]);
ObjectSet("pr" + sName, 14, 159);
return(0);
}
I thought, simple calling from EA for the COG's buffer number should work:
Comment("sqh: ", iCustom(Symbol(), 0, "Center of Gravity#2", 1, 0), "\n",
"sql: ", iCustom(Symbol(), 0, "Center of Gravity#2", 2, 0), "\n",
"stdh: ", iCustom(Symbol(), 0, "Center of Gravity#2", 3, 0), "\n",
"stdl: ", iCustom(Symbol(), 0, "Center of Gravity#2", 4, 0));
but it does not for me - anyone to show my error?
Many thanks.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello Guys,
pls kindly see attached screen - I would like to see in a Comment() the last (current) values of the gravity lines.
Tried different ways but can not get to the buffer data - kindly askig for your help!
Indicator's mq4 is attached.