sam09:
Hello,
I try to draw the Differenze between Ask and MA in Pips as text with ObjectCreate, but it doesn't work. where is mistake.
Hello,
I try to draw the Differenze between Ask and MA in Pips as text with ObjectCreate, but it doesn't work. where is mistake.
Thank you
Source Code:
Try it out (I didnt do that):
//+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { ObjectCreate("Diff",OBJ_LABEL,0,0,0,0,0); // Creating obj. ObjectSet("Diff", OBJPROP_XDISTANCE,scaleX+offsetX);// X coordinate ObjectSet("Diff", OBJPROP_YDISTANCE,scaleY+offsetY);// Y coordinate ObjectSetText("Diff","0",fontSize,"Arial",White); return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- ObjectDelete("Diff"); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { digits = MarketInfo(Symbol(),MODE_DIGITS); MA = iMA(Symbol(),0, MA_Period, 0, ma_method, applied_price, 0); difference = Ask - MA; if (difference >= 0){ ObjectSetText("Diff",DoubleToStr(difference, digits),fontSize,"Arial",Lime); } else{ ObjectSetText("Diff",DoubleToStr(difference, digits),fontSize,"Arial",Red); } return(0); }Cheers
ggekko:
Try it out (I didnt do that):
CheersThank you very much .. it works.
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
I try to draw the Differenze between Ask and MA in Pips as text with ObjectCreate, but it doesn't work. where is mistake.
Thank you
Source Code: