Channel Midline

 

Hello and thank you for your useful program(mt5)...please add the middle line to the parallel channels in the new update, thanks alot

 
mohar1995:

Hello and thank you for your useful program(mt5)...please add the middle line to the parallel channels in the new update, thanks alot

easy to create mid line for yourself... could be a good idea for a custom indicator.

   datetime time_start = ObjectGetInteger(ChartID(), "channel name", OBJPROP_TIME, 0);
   datetime time_end = ObjectGetInteger(ChartID(), "channel name", OBJPROP_TIME, 1);
   double value_start_lower = ObjectGetValueByTime(ChartID(), "channel name", time_start, 0);
   double value_start_upper = ObjectGetValueByTime(ChartID(), "channel name", time_start, 1);
   double value_end_lower = ObjectGetValueByTime(ChartID(), "channel name", time_end, 0);
   double value_end_upper = ObjectGetValueByTime(ChartID(), "channel name", time_end, 1);
   double mid_start=(value_start_lower+value_start_upper)/2;
   double mid_end=(value_end_lower+value_end_upper)/2;
   ObjectCreate(ChartID(), "mid_line", OBJ_TREND, 0, time_start, mid_start, time_end, mid_end);
 
Yashar Seyyedin #:

easy to create mid line for yourself... could be a good idea for a custom indicator.

Thank you Brother, it was great.. I expanded your post... We will draw a parallel channel and name it "A", in this case, I will extend the middle line of the channel to the right and left, and today's price will hit the middle. I also wrote the channel...thank you very much

void OnStart()
  {
   datetime time_start = ObjectGetInteger(ChartID(), "A", OBJPROP_TIME, 0);
   datetime time_end = ObjectGetInteger(ChartID(), "A", OBJPROP_TIME, 1);
   double value_start_lower = ObjectGetValueByTime(ChartID(), "A", time_start, 0);
   double value_start_upper = ObjectGetValueByTime(ChartID(), "A", time_start, 1);
   double value_end_lower = ObjectGetValueByTime(ChartID(), "A", time_end, 0);
   double value_end_upper = ObjectGetValueByTime(ChartID(), "A", time_end, 1);
   double mid_start=(value_start_lower+value_start_upper)/2;
   double mid_end=(value_end_lower+value_end_upper)/2;
   ObjectCreate(ChartID(), "mid_line", OBJ_TREND, 0, time_start, mid_start, time_end, mid_end);
   ObjectSetInteger(0,"mid_line",OBJPROP_RAY_RIGHT,true);
   ObjectSetInteger(0,"mid_line",OBJPROP_RAY_LEFT,true);
   Comment(NormalizeDouble(ObjectGetValueByTime(0,"mid_line",TimeCurrent(),0),Digits())); }
 
mohar1995 #:Thank you Brother, it was great.. I expanded your post... We will draw a parallel channel and name it "A", in this case, I will extend the middle line of the channel to the right and left, and today's price will hit the middle. I also wrote the channel...thank you very much

Your ".ex5" file attachment has been removed. Please only attach source code files.

And please only annotate in English, not in any other language. This is the English forum.

 
mohar1995 #:

Thank you Brother, it was great.. I expanded your post... We will draw a parallel channel and name it "A", in this case, I will extend the middle line of the channel to the right and left, and today's price will hit the middle. I also wrote the channel...thank you very much

Happy to hear that. You are welcome.