Envelopes beginner tutorial by William210

Author: Copyright 2023, GwDs
0 Views
0 Downloads
0 Favorites
Envelopes beginner tutorial by William210
ÿþ//+------------------------------------------------------------------+

//|                    Envelopes beginner tutorial By William210.mq5 |

//|                                             Copyright 2023, GwDs |

//|                                    Need more help? Contact me on |

//|                         https://www.mql5.com/fr/users/william210 |

//+------------------------------------------------------------------+

//+-__-__-__-__-__-__-__-__-__-__-__-__-__-__-__-__-__-__-__-__-__-__-

//+-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-



#property copyright "Copyright 2023, GwDs"



#property version   "1.01" // 949



#property description "My apologies, this code is no longer available and I don't know how to remove/hide it from codebase"





//+-__-__-__-__-__-__-__-__-__-__-__-__-__-__-__-__-__-__-__-__-__-__-

// --- Indicator preference

input int                  g_period         = 14;            // Period of moving average

input int                  g__shift         = 0;             // Shift

input ENUM_MA_METHOD       g__method        = MODE_SMA;      // Type of smoothing

input ENUM_APPLIED_PRICE   g_applied_price  = PRICE_CLOSE;   // Type of price

input double               g_deviation      = 0.1;           // deviation of borders from the moving average



//+-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-

// --- Graph placement

#property indicator_chart_window



//+-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-

// --- Buffer declaration

#property   indicator_buffers     2    // Number of buffer displayed

#property   indicator_plots      2     // Number of plot on the graph



//+-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-

// --- Pointer of the iEnvelopes function

int         g_PtEnvelope   = INVALID_HANDLE;



double      g_EnvBuffUp[];                    // Data buffer

#define     g_IndexEnvBuffUp           0      // Index of buffer  



//+-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-

// --- Buffer plot characteristics

#property   indicator_label1  "Upper"         // Label            

#property   indicator_type1   DRAW_LINE       // Plot type        

#property   indicator_color1  clrBlue         // Color            

#property   indicator_style1  STYLE_SOLID     // Plot style       

#property   indicator_width1  1               // Plot width       



double      g_EnvBuffDw[];                    // Data buffer

#define     g_IndexEnvBuffDw           1      // Index of buffer  



//+-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-

// --- Buffer plot characteristics

#property   indicator_label2  "Lower"         // Label            

#property   indicator_type2   DRAW_LINE       // Plot Type        

#property   indicator_color2  clrRed          // Color            

#property   indicator_style2  STYLE_SOLID     // Plot style       

#property   indicator_width2  1               // Plot width       



//+------------------------------------------------------------------+

//|   OnInit                                                         |

//+------------------------------------------------------------------+

int OnInit()



{

  Comment( "My apologies, this code is no longer available and I don't know how to remove/hide it from codebase");



  return( INIT_SUCCEEDED);

}



//+------------------------------------------------------------------+

//|   OnCalculate                                                    |

//+------------------------------------------------------------------+

int OnCalculate( const int        rates_total,      // Total number of bars to be processed

                 const int        prev_calculated,  // Number of bars calculated in the previous call

                 const datetime   &time[],          // Array of bar times

                 const double     &open[],          // Array of bar open prices

                 const double     &high[],          // Array of bar high prices

                 const double     &low[],           // Array of bar low prices

                 const double     &close[],         // Array of bar close prices

                 const long       &tick_volume[],   // Array of tick volumes for each bar

                 const long       &volume[],        // Array of real volumes for each bar

                 const int        &spread[])        // Array of spreads for each bar



{

  return(rates_total);

}



//+------------------------------------------------------------------+

//|   OnDeinit                                                       |

//+------------------------------------------------------------------+

void OnDeinit(const int reason)



{

Comment( "");

}



//+------------------------------------------------------------------+

//| The End, That s All Folks!                                       |

//+------------------------------------------------------------------+

//+-__-__-__-__-__-__-__-__-__-__-__-__-__-__-__-__-__-__-__-__-__-__-

//+-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-

Comments

Markdown supported. Formatting help

Markdown Formatting Guide

Element Markdown Syntax
Heading # H1
## H2
### H3
Bold **bold text**
Italic *italicized text*
Link [title](https://www.example.com)
Image ![alt text](image.jpg)
Code `code`
Code Block ```
code block
```
Quote > blockquote
Unordered List - Item 1
- Item 2
Ordered List 1. First item
2. Second item
Horizontal Rule ---