Download MetaTrader 5

DRAW LINE in main chart when buffer's are in seperate window, IS IT POSSIBLE?

To add comments, please log in or register
Mehrdad Shiri
4513
Mehrdad Shiri  

HI;

i have an indicator and used " iAlligator" handle and i have buffer .

can draw Alligator line's in main chart with this?

Alain Verleyen
Moderator
31204
Alain Verleyen  
TIMisthebest:

HI;

i have an indicator and used " iAlligator" handle and i have buffer .

can draw Alligator line's in main chart with this?

You want to draw in main window AND in a separate window with 1 indicator ?
Mehrdad Shiri
4513
Mehrdad Shiri  
angevoyageur:
You want to draw in main window AND in a separate window with 1 indicator ?

for a mql5 indicator , i used it as separate window and i have

.
.
#property indicator_separate_window
#property indicator_buffers 25
#property indicator_plots   19
.
.
//------------------------------------------------------------------------------------------ Alligator
//
#property indicator_label15  "Alligator_Bullish"
#property indicator_type15   DRAW_ARROW
#property indicator_color15  Blue
#property indicator_style15  STYLE_SOLID
#property indicator_width15  3
#property indicator_label16  "Alligator_Bearish"
#property indicator_type16   DRAW_ARROW
#property indicator_color16  Red
#property indicator_style16  STYLE_SOLID
#property indicator_width16  3
#property indicator_label17  "Alligator_Range"
#property indicator_type17   DRAW_ARROW
#property indicator_color17  White 
#property indicator_style17  STYLE_SOLID
#property indicator_width17  3
//
//---- input parameters
int                InpJawsPeriod=13;               // Jaws period
int                InpJawsShift=0;                 // Jaws shift
int                InpTeethPeriod=8;               // Teeth period
int                InpTeethShift=0;                // Teeth shift  
int                InpLipsPeriod=5;                // Lips period
int                InpLipsShift=0;                 // Lips shift  
ENUM_MA_METHOD     InpMAMethod=MODE_SMMA;          // Moving average method
ENUM_APPLIED_PRICE InpAppliedPrice=PRICE_MEDIAN;   // Applied price
//
double Alligator_ExtJaws[];
double Alligator_ExtTeeth[];
double Alligator_ExtLips[];
//
int    Alligator_Handle;
//
double    Alligator_Bullish_Buffer[],Alligator_Bearish_Buffer[],Alligator_Range_Buffer[];
//
uchar    Alligator_Code=158;
.
.
.
//+------------------------------------------------------------------+
void OnInit()
  {
//--------------------------------------------------------------
.
.
//------------------------------------------------------------------------------------------ Alligator
   Alligator_Handle=iAlligator(NULL,0,InpJawsPeriod,InpJawsShift,InpTeethPeriod,InpTeethShift,
                                      InpLipsPeriod,InpLipsShift,InpMAMethod,InpAppliedPrice);   
   ArraySetAsSeries(Alligator_ExtJaws,true);
   ArraySetAsSeries(Alligator_ExtTeeth,true);
   ArraySetAsSeries(Alligator_ExtLips,true);
   //
   SetIndexBuffer(16,Alligator_Bullish_Buffer,INDICATOR_DATA);
   SetIndexBuffer(17,Alligator_Bearish_Buffer,INDICATOR_DATA);
   SetIndexBuffer(18,Alligator_Range_Buffer,INDICATOR_DATA);
   ArraySetAsSeries(Alligator_Bullish_Buffer,true);
   ArraySetAsSeries(Alligator_Bearish_Buffer,true);
   ArraySetAsSeries(Alligator_Range_Buffer,true);
   //
   PlotIndexSetInteger(14,PLOT_DRAW_BEGIN,InpJawsPeriod-1);
   PlotIndexSetInteger(15,PLOT_DRAW_BEGIN,InpTeethPeriod-1);
   PlotIndexSetInteger(16,PLOT_DRAW_BEGIN,InpLipsPeriod-1);
   //
   PlotIndexSetString(14,PLOT_LABEL,"Alligator_Bullish");
   PlotIndexSetString(15,PLOT_LABEL,"Alligator_Bearish");
   PlotIndexSetString(16,PLOT_LABEL,"Alligator_Range");
   //
   PlotIndexSetDouble(14,PLOT_EMPTY_VALUE,EMPTY_VALUE);
   PlotIndexSetDouble(15,PLOT_EMPTY_VALUE,EMPTY_VALUE);
   PlotIndexSetDouble(16,PLOT_EMPTY_VALUE,EMPTY_VALUE);
   //
   PlotIndexSetInteger(14,PLOT_ARROW,Alligator_Code);
   PlotIndexSetInteger(15,PLOT_ARROW,Alligator_Code);
   PlotIndexSetInteger(16,PLOT_ARROW,Alligator_Code);
.
.
.
//+------------------------------------------------------------------+
int OnCalculate(
.
.
//------------------------------------------------------------------------------------------ Alligator
   int copy_Alligator_ExtJaws=CopyBuffer(Alligator_Handle,0,0,rates_total,Alligator_ExtJaws);
   int copy_Alligator_ExtTeeth=CopyBuffer(Alligator_Handle,1,0,rates_total,Alligator_ExtTeeth);
   int copy_Alligator_ExtLips=CopyBuffer(Alligator_Handle,2,0,rates_total,Alligator_ExtLips);
//-----------
.
.
//----------------------------------------------------------------------------------------------------------//   
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//----------------------------------------------------------------------------------------------------------//

i want to draw alligator's line from this indicator in main chart.

thank you to reply

Documentation on MQL5: Standard Constants, Enumerations and Structures / Environment State / Running MQL5 Program Properties
Documentation on MQL5: Standard Constants, Enumerations and Structures / Environment State / Running MQL5 Program Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Environment State / Running MQL5 Program Properties - Documentation on MQL5
Mehrdad Shiri
4513
Mehrdad Shiri  

i draw in separate window arrow from that buffer

and i want also draw line with that buffer in main chart

is it possible ?

Alain Verleyen
Moderator
31204
Alain Verleyen  
TIMisthebest:

for a mql5 indicator , i used it as separate window and i have

i want to draw alligator's line from this indicator in main chart.

thank you to reply

I don't think it is possible to plot some buffers in a separate window and some in main window. Anyway why doing that ?
Mehrdad Shiri
4513
Mehrdad Shiri  
angevoyageur:
I don't think it is possible to plot some buffers in a separate window and some in main window. Anyway why doing that ?

make it user friendly indicator.

  in one indicator all i need  ; -)

Alain Verleyen
Moderator
31204
Alain Verleyen  
TIMisthebest:

make it user friendly indicator.

  in one indicator all i need  ; -)

Then make 2. One in main window and one in separate window.

Do you know you can use a template with all the indicators you need ?

Mehrdad Shiri
4513
Mehrdad Shiri  
angevoyageur:

Do you know you can use a template with all the indicators you need ?

yes ;-)

and i working on mql5 coding to learning.

thank you again.

Mehrdad Shiri
4513
Mehrdad Shiri  
angevoyageur:

oh, excuse me,

if i have new buffer's ( with new handle to take value from "iAlligator" )

can use it to draw alligator's line in main chart ?

( and they are just take value in separate window and don't draw in it ; they draw in main chart ) is it possible ?

Mehrdad Shiri
4513
Mehrdad Shiri  
kourosh1347:

hi again mehrdad

hi;

yes with OBJ_TREND line can do it.

thank you.
Documentation on MQL5: Standard Constants, Enumerations and Structures / Objects Constants / Object Types
Documentation on MQL5: Standard Constants, Enumerations and Structures / Objects Constants / Object Types
  • www.mql5.com
Standard Constants, Enumerations and Structures / Objects Constants / Object Types - Documentation on MQL5
To add comments, please log in or register