Page 1 of 2

Request Indicator MA as Lines

PostPosted: Wed Sep 27, 2017 9:46 am
by Ehab.Ali
can you please help with that i found an indicator but closed source and not working
i need the same idea and settings in a working indicator for mt4 plus alert when price touch any line
Lines auto change it self with moving price
and thank you a lot

MA-Horizontal-Lines-Indicator.ex4
(69.48 KiB) Downloaded 519 times

Re: Request Indicator MA as Lines

PostPosted: Mon Oct 02, 2017 5:01 am
by Apprentice
Unfortunately I can not help you.
The indicator is encoded in EX4 format.
Can you provide MQ4 version, a description, a screenshot?

Re: Request Indicator MA as Lines

PostPosted: Mon Oct 02, 2017 6:38 am
by Ehab.Ali
yes i can provide screenshots sir
first thanks for answer

idea is making an indicator for mt4 create 4 dynamic lines for 4 moving averages (ema,sma, etc) current price
with alert if price touch any of this lines

example
ma 1 - 4h price = 151.30
then create Horizontal line with lable (sma 1 frame 4h) on price 151.30
if moving price changes line auto movr to the new price

same option for the other ma2 / ma3 / ma4
attached screen shots for indicator setting

thank you a lot sir

Re: Request Indicator MA as Lines

PostPosted: Tue Oct 03, 2017 4:02 am
by Apprentice
Your request is added to the development list under Id Number 3915

Re: Request Indicator MA as Lines

PostPosted: Tue Oct 03, 2017 5:07 am
by Apprentice
If you decide to TS2 platform.
Try this TS2 / Marketscope version
viewtopic.php?f=17&t=65142&p=115232#p115232

Re: Request Indicator MA as Lines

PostPosted: Tue Oct 03, 2017 8:46 am
by Ehab.Ali
Apprentice wrote:If you decide to TS2 platform.
Try this TS2 / Marketscope version
viewtopic.php?f=17&t=65142&p=115232#p115232



THANK YOU SIR BUT I'M WORK ON MT4

Re: Request Indicator MA as Lines

PostPosted: Tue Oct 03, 2017 12:36 pm
by Apprentice
I'm aware of that.
The Mq4 version is in the pipeline.
This was for the TS2 community.

Re: Request Indicator MA as Lines

PostPosted: Thu Oct 05, 2017 11:19 am
by Alexander.Gettinger
Unfortunately, I can not start the indicator.
It writes a message "The name of this software cannot be changed".

Can you provide screenshots and description?

Re: Request Indicator MA as Lines

PostPosted: Fri Oct 06, 2017 6:59 am
by Ehab.Ali
Alexander.Gettinger wrote:Unfortunately, I can not start the indicator.
It writes a message "The name of this software cannot be changed".

Can you provide screenshots and description?



Sir thanks in advance
Can you forget the attached indicator and help me with the idea to create this indicator

idea is making an indicator for mt4 create 4 dynamic lines for 4 moving averages (ema,sma, etc) current price
with alert if price touch any of this lines

example
ma 1 - 4h price = 151.30
then create Horizontal line with lable (sma 1 frame 4h) on price 151.30
if moving price changes line auto movr to the new price

same option for the other ma2 / ma3 / ma4
attached screen shots for indicator setting

thank you a lot sir

Re: Request Indicator MA as Lines

PostPosted: Fri Oct 06, 2017 7:11 am
by Ehab.Ali
example create 4 lines same as moving average

Code: Select all
#property indicator_chart_window

int init() {
   return (0);
}

int deinit() {
   return (0);
}

int start() {
   int l_ind_counted_0 = IndicatorCounted();
   ObjectsDeleteAll(0, OBJ_HLINE);
 
   double l_ima_4 = iMA(Symbol(), PERIOD_CURRENT, 5, 0, MODE_EMA, PRICE_CLOSE, 0);
   double l_ima_12 = iMA(Symbol(), PERIOD_CURRENT, 20, 0, MODE_SMA, PRICE_CLOSE, 0);
   double l_ima_20 = iMA(Symbol(), PERIOD_CURRENT, 30, 0, MODE_EMA, PRICE_CLOSE, 0);
   double l_ima_28 = iMA(Symbol(), PERIOD_CURRENT, 60, 0, MODE_SMA, PRICE_CLOSE, 0);



   
   drawLine(l_ima_4, DoubleToStr(l_ima_4, Digits),DarkGray , 1);
   drawLabel("5", l_ima_4, DarkGray);
   drawLine(l_ima_12, DoubleToStr(l_ima_12, Digits), DarkGray, 1);
   drawLabel("20", l_ima_12, DarkGray);
   drawLine(l_ima_20, DoubleToStr(l_ima_20, Digits), DarkGray, 1);
   drawLabel("30", l_ima_20, DarkGray);
   drawLine(l_ima_28, DoubleToStr(l_ima_28, Digits), DarkGray, 1);
   drawLabel("60", l_ima_28, DarkGray);

   
   return (0);
}

void drawLabel(string a_name_0, double a_price_8, color a_color_16) {
   if (ObjectFind(a_name_0) != 0) {
      ObjectCreate(a_name_0, OBJ_TEXT, 0, Time[10], a_price_8);
      ObjectSetText(a_name_0, a_name_0, 10, "Arial", CLR_NONE);
      ObjectSet(a_name_0, OBJPROP_COLOR, a_color_16);
      return;
   }
   ObjectMove(a_name_0, 0, Time[10], a_price_8);
}

void drawLine(double a_price_0, string a_name_8, color a_color_16, int ai_20) {
   if (ObjectFind(a_name_8) != 0) {
      ObjectCreate(a_name_8, OBJ_HLINE, 0, Time[0], a_price_0, Time[0], a_price_0);
      if (ai_20 == 1) ObjectSet(a_name_8, OBJPROP_STYLE, STYLE_SOLID);
      else ObjectSet(a_name_8, OBJPROP_STYLE, STYLE_DOT);
      ObjectSet(a_name_8, OBJPROP_COLOR, a_color_16);
      ObjectSet(a_name_8, OBJPROP_WIDTH, 1);
      return;
   }
   ObjectDelete(a_name_8);
   ObjectCreate(a_name_8, OBJ_HLINE, 0, Time[0], a_price_0, Time[0], a_price_0);
   if (ai_20 == 1) ObjectSet(a_name_8, OBJPROP_STYLE, STYLE_SOLID);
   else ObjectSet(a_name_8, OBJPROP_STYLE, STYLE_DOT);
   ObjectSet(a_name_8, OBJPROP_COLOR, a_color_16);
   ObjectSet(a_name_8, OBJPROP_WIDTH, 1);
}


but need to add options to the settings like
choose m1 / color /PERIOD / method / timeframe
choose m2 / color /PERIOD/ method / timeframe
choose m3 / color /PERIOD/ method / timeframe
choose m4 / color /PERIOD/ method / timeframe
alert when price touch the line