Join our fan page
- Views:
- 3298
- Rating:
- Published:
- 2024.01.27 14:48
-
Need a robot or indicator based on this code? Order it on Freelance Go to Freelance
The MT5 custom indicator, named 'wd.Range_BB,' is designed to display Bollinger Bands with customized colors and line styles on the chart and calculate the range bandwidth. The range bandwidth is the difference in pips between the upper and lower Bollinger Bands.
Here's how the indicator works:
Bollinger Bands Settings:
These parameters allow users to customize the appearance and behavior of the Bollinger Bands. User can adjust the period, shift, deviation, and applied price for the Bollinger Bands, as well as the visual aspects such as color and line style.
Place the 'range/bandwidth information' label in the specified Sub-Window:
The Sub-Window input parameter specifies the sub-window number where the labels need to be placed.
UpperBB-LowerBB distance information can be placed in the main chart or sub-window. User can also adjust label distances (X and Y-Position).
To place labels in the main chart, simply input '0' in the 'Sub-Window placement' properties.
To place them in a Sub-Window below, input ‘1 or 2 or 3, etc’. User need to attach indicator “wd.Multi_SubWindow” {wd.Multi_SubWindow.mq5 attached}.
![](https://c.mql5.com/18/153/wd.Range_BB_v2.24_hChart_Propertiesf.jpg)
Overall, the 'wd.Range_BB' indicator displays the range bandwidth in a label, and the Bollinger Bands are plotted on the main chart. This indicator can help users visualize the flexibility and volatility of the market based on the width of the Bollinger Bands.
![Sec-WebSocket-Key Generator](https://c.mql5.com/i/code/script.png)
Sec-WebSocket-Key Generator
![Open Trade](https://c.mql5.com/i/code/script.png)
This function performs the main logic of opening a trade. Calculates the opening price, take profit levels and stop loss based on symbol information and parameters provided by the user. Prepare a trade request (MqlTradeRequest) with the necessary information, such as symbol, volume, order type, deviation, comment, magic number, etc. Call the OrderSend function to send the operation request and get the result. SetTypeFillingBySymbol function: Determines the order fill type (Fill or Kill, Immediate or Cancel, or Return) based on the symbol's filling policy. GetMinTradeLevel function: Calculates the minimum operating level based on the freeze level and the symbol stops level. Adjusts the minimum level to make sure it is within certain limits and returns the result.
![Moving Averages-14 different types](https://c.mql5.com/i/code/indicator.png)
This is an indicator to calculate 14 types of moving averages based on close price.
![Candle Fitness](https://c.mql5.com/i/code/indicator.png)
Candlestick Fitness concept is used in coding HFT Algos based on population optimization algorithms.