Description
Introduction
The VWAP Anchored indicator is an advanced tool designed for the cTrader platform. It enables traders to analyze the markets using a customized version of the Volume-Weighted Average Price (VWAP), a key indicator used to determine the average price of an asset weighted by volume over a given period. This indicator is particularly useful for identifying entry and exit points as well as for tracking market trends.
Key Features
Customizable Period: The VWAP Anchored indicator allows users to select the period for calculating the indicator. Two options are available:
- Period Number: Allows you to directly specify the period in terms of the number of bars.
- Mouse Click: Allows you to set the period by clicking directly on a point on the chart, making the indicator extremely flexible and interactive.
Overlay Display: The indicator is overlaid directly on the price chart, providing a clear visualization of the relationship between the current price and the VWAP.
Interactivity: The integration of mouse events (MouseUp and MouseMove) allows traders to manipulate the indicator directly from the chart in real-time, offering a more intuitive user experience.
Indicator Parameters
Method VWAP : This parameter determines the method used to calculate the VWAP period. You can choose between a fixed period (Period Number) or a period defined by a mouse click on the chart (Mouse Click).
Period VWAP : This parameter sets the VWAP calculation period when using the Period Number method. By default, this value is set to 55.
How the Indicator Works
When applied to a chart, the VWAP Anchored calculates the volume-weighted average price from the period defined by the user up to the current period. The calculation is based on typical prices and transaction volumes, allowing it to accurately reflect the impact of volumes on prices.
The indicator then plots a line on the chart, displaying the VWAP for the chosen period. Using the "Mouse Click" method, the trader can adjust the calculation period simply by clicking on the chart, which is particularly useful for real-time analysis.
Conclusion
The VWAP Anchored is a powerful and flexible tool for traders using cTrader, combining the robustness of the traditional VWAP with the flexibility of intuitive customization. Whether you're a beginner or an experienced trader, this indicator can enhance your technical analysis and help you make more informed trading decisions.
Install the VWAP Anchored indicator on your cTrader platform now and see how it can transform your trading approach!
Enjoy for Free =)
Previous account here : https://ctrader.com/users/profile/70920
Contact telegram : https://t.me/nimi012
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using cAlgo.API;
using cAlgo.API.Collections;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
namespace cAlgo
{
[Indicator(IsOverlay = true, AccessRights = AccessRights.None)]
public class VWAPAnchored : Indicator
{
[Parameter("Metode VWAP", DefaultValue = EnumMetode.Period_Number)]
public EnumMetode Metode { get; set; }
public enum EnumMetode
{
Period_Number,
Mouse_Click
}
[Parameter("Period VWAP", DefaultValue = 55)]
public int PeriodVWAP { get; set; }
[Output("Result", LineColor = "DeepSkyBlue", PlotType = PlotType.Line)]
public IndicatorDataSeries Result { get; set; }
int nbrBars;
int startIndex;
string startIndicator;
protected override void Initialize()
{
startIndicator = Time.ToString();
nbrBars = Bars.Count;
Chart.MouseUp += OnChartMouseUp;
Chart.MouseMove += OnChartMouseMove;
}
private void OnChartMouseUp(ChartMouseEventArgs args)
{
if (Metode == EnumMetode.Mouse_Click)
PeriodVWAP = Bars.Count - (int)args.BarIndex;
Chart.DrawStaticText("Period", "Period at this Bar : " + (Bars.Count - (int)args.BarIndex).ToString(), VerticalAlignment.Top, HorizontalAlignment.Right, Color.DeepSkyBlue); ;
}
private void OnChartMouseMove(ChartMouseEventArgs args)
{
Chart.DrawStaticText("Period", "Period at this Bar : " + (Bars.Count - (int)args.BarIndex).ToString(), VerticalAlignment.Top, HorizontalAlignment.Right, Color.DeepSkyBlue); ;
}
public override void Calculate(int index)
{
startIndex = nbrBars - PeriodVWAP;
int endIndex = nbrBars;
double sumPV = 0.0;
double sumVolume = 0.0;
for (int i = startIndex; i < endIndex; i++)
{
sumPV += Bars.TypicalPrices[i] * Bars.TickVolumes[i];
sumVolume += Bars.TickVolumes[i];
Result[i] = sumPV / sumVolume;
}
}
}
}
YesOrNot2
Joined on 17.05.2024
- Distribution: Free
- Language: C#
- Trading platform: cTrader Automate
- File name: VWAPAnchored.algo
- Rating: 0
- Installs: 685
- Modified: 08/08/2024 21:07