VWAP_Oscillator_normilized

Custom MT4 expert advisors published here.

Moderator: admin


Re: VWAP_Oscillator_normilized

Postby aladdin007 » Mon May 25, 2020 6:15 pm

hi Mr Mario apprentice

why every monday the vwap 2 lines look like that ?
Attachments
vwap oscillator normalized.jpg
aladdin007
 
Posts: 97
Joined: Sat Aug 24, 2019 1:28 pm

Re: VWAP_Oscillator_normilized

Postby Apprentice » Tue May 26, 2020 8:20 am

VWAP is calculated like this.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: VWAP_Oscillator_normilized

Postby aladdin007 » Tue May 26, 2020 2:12 pm

Can you make Vwap oscillator normalized show and being like that every day not just on Monday ?
aladdin007
 
Posts: 97
Joined: Sat Aug 24, 2019 1:28 pm

Re: VWAP_Oscillator_normilized

Postby Apprentice » Wed May 27, 2020 5:06 am

Your request is added to the development list.
Development reference 1370.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: VWAP_Oscillator_normilized

Postby aladdin007 » Mon Jun 08, 2020 12:24 pm

Hi Mr Mario apprentice
Any news about the indicator ?

Thank you
aladdin007
 
Posts: 97
Joined: Sat Aug 24, 2019 1:28 pm

Re: VWAP_Oscillator_normilized

Postby Apprentice » Tue Jun 09, 2020 6:15 am

Unfortunately no,
we are overwhelmed by task inflow.
I will post any updates here.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: VWAP_Oscillator_normilized

Postby Apprentice » Thu Jun 11, 2020 6:08 am

How Normalization will be calculated?
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: VWAP_Oscillator_normilized

Postby aladdin007 » Thu Jun 11, 2020 6:20 am

I want him in each new day return to zero and star new calculations so I can have this kind of signals he give every Monday
Attachments
CA4572F6-6ED9-4F78-8682-BDFAD87858A3.jpeg
aladdin007
 
Posts: 97
Joined: Sat Aug 24, 2019 1:28 pm

Re: VWAP_Oscillator_normilized

Postby aladdin007 » Fri Jun 12, 2020 11:20 pm

Hi Mr Mario apprentice

Please add time frame 5,15,30,h1..
Please add the option add symbols,so I can add different symbols at the same chart
Thank you so much

This is the script
https://ctrader.com/algos/indicators/show/2142

Code: Select all
using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;
 
namespace cAlgo
{
    [Levels(0, 1, 2, 3, -1, -2, -3)]
    [Indicator(IsOverlay = false, ScalePrecision = 1, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class VWAPOscilattor : Indicator
    {
        [Parameter(DefaultValue = 5)]
        public int Thickness { get; set; }
        [Parameter(DefaultValue = 11)]
        public TimeFrame TF { get; set; }
 
        [Output("Open", PlotType = PlotType.Points, LineColor = "Black")]
        public IndicatorDataSeries Open { get; set; }
        [Output("High", PlotType = PlotType.Points, LineColor = "Black")]
        public IndicatorDataSeries High { get; set; }
        [Output("Loe", PlotType = PlotType.Points, LineColor = "Black")]
        public IndicatorDataSeries Low { get; set; }
        [Output("Close", PlotType = PlotType.Points, LineColor = "Black")]
        public IndicatorDataSeries Close { get; set; }
 
        [Output("0", LineColor = "Gray")]
        public IndicatorDataSeries ZeroLine { get; set; }
        [Output("1", LineColor = "FFFF999A")]
        public IndicatorDataSeries FirstUpperBand { get; set; }
        [Output("2", LineColor = "FFFF5B62")]
        public IndicatorDataSeries SecondUpperBand { get; set; }
        [Output("3", LineColor = "FFFF0000")]
        public IndicatorDataSeries ThirdUpperBand { get; set; }
        [Output("-1", LineColor = "FF9CFF9C")]
        public IndicatorDataSeries FirstLowerBand { get; set; }
        [Output("-2", LineColor = "FF4EFF4E")]
        public IndicatorDataSeries SecondLowerBand { get; set; }
        [Output("-3", LineColor = "FF00FF00")]
        public IndicatorDataSeries ThirdLowerBand { get; set; }
 
        Bars Series;
 
        protected override void Initialize()
        {
            Series = MarketData.GetBars(TF);
        }
 
        public override void Calculate(int index)
        {
            double vwapValue = 0, volumesSum = 0;
            int startIndex = Bars.OpenTimes.GetIndexByTime(Series.OpenTimes[Series.OpenTimes.GetIndexByTime(Bars.OpenTimes[index])]);
 
            for (int i = index; i >= startIndex; i--)
            {
                vwapValue += Bars[i].Close * Bars[i].TickVolume;
                volumesSum += Bars[i].TickVolume;
            }
 
            vwapValue /= volumesSum;
 
            double vwapSTD = 0;
 
            for (int i = index; i >= startIndex; i--)
            {
                vwapSTD += Math.Pow(Bars[i].Close - vwapValue, 2);
            }
            vwapSTD = Math.Sqrt(vwapSTD / (index - startIndex + 1));
 
            Close[index] = (Bars[index].Close - vwapValue) / vwapSTD;
            Open[index] = (Bars[index].Open - vwapValue) / vwapSTD;
            High[index] = (Bars[index].High - vwapValue) / vwapSTD;
            Low[index] = (Bars[index].Low - vwapValue) / vwapSTD;
 
            Close[index] = double.IsInfinity(Close[index]) ? 0 : Close[index];
            Open[index] = double.IsInfinity(Open[index]) ? 0 : Open[index];
            High[index] = double.IsInfinity(High[index]) ? 0 : High[index];
            Low[index] = double.IsInfinity(Low[index]) ? 0 : Low[index];
 
            Close[index] = Close[index] > 5 ? 5 : Close[index] < -5 ? -5 : Close[index];
            Open[index] = Open[index] > 5 ? 5 : Open[index] < -5 ? -5 : Open[index];
            High[index] = High[index] > 5 ? 5 : High[index] < -5 ? -5 : High[index];
            Low[index] = Low[index] > 5 ? 5 : Low[index] < -5 ? -5 : Low[index];
 
            IndicatorArea.DrawTrendLine("HL " + index, index, High[index], index, Low[index], Close[index] > Open[index] ? Color.Green : Color.Red);
            IndicatorArea.DrawTrendLine("Body " + index, index, Close[index], index, Open[index], Close[index] > Open[index] ? Color.Green : Color.Red, Thickness);
 
            ZeroLine[index] = 0;
            FirstLowerBand[index] = -1;
            FirstUpperBand[index] = 1;
            SecondLowerBand[index] = -2;
            SecondUpperBand[index] = 2;
            ThirdLowerBand[index] = -3;
            ThirdUpperBand[index] = 3
aladdin007
 
Posts: 97
Joined: Sat Aug 24, 2019 1:28 pm

Next

Return to MT4 Expert Advisors

Who is online

Users browsing this forum: No registered users and 9 guests