Category Other  Published on 12/04/2017

JPA Simple Session Pivot

Description

Shows the pivot point of the current session.

 


// -------------------------------------------------------------------------------------------------
//
//    JPA Simple Session Pivot
//    
//    http://justpriceaction.com
//
// -------------------------------------------------------------------------------------------------


using System;
using System.Collections;
using System.Collections.Generic;
using System.Drawing;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;


namespace cAlgo.Indicators
{
    [Indicator("JPA SIMPLE PIVOT", IsOverlay = true, ScalePrecision = 5, TimeZone = TimeZones.EEuropeStandardTime, AccessRights = AccessRights.None)]
    public class JPASP : Indicator
    {


        ArrayList jpaSymbolBarP = new ArrayList();


        protected override void Initialize()
        {

            ChartObjects.RemoveAllObjects();

        }


        public override void Calculate(int index)
        {

            var symbolBarDate = Server.Time;

            var symbolSessionOpenDate = new DateTime(symbolBarDate.Year, symbolBarDate.Month, symbolBarDate.Day);

            if (this.MarketSeries.OpenTime[index] > symbolSessionOpenDate && IsRealTime == false)
            {

                jpaSymbolBarP.Add((MarketSeries.High[index] + MarketSeries.Low[index] + MarketSeries.Close[index]) / 3);

            }


            double pv = 0;

            foreach (double p in jpaSymbolBarP)
            {
                pv = pv + p;
            }

            double pva = pv / jpaSymbolBarP.Count;

            ChartObjects.DrawHorizontalLine("Pivot", pva, Colors.LightGray, 1, LineStyle.Lines);

        }


    }
}


r.uygar's avatar
r.uygar

Joined on 11.04.2017

  • Distribution: Free
  • Language: C#
  • Trading platform: cTrader Automate
  • File name: JPA-SP.algo
  • Rating: 5
  • Installs: 3074
  • Modified: 13/10/2021 09:54
Comments
Log in to add a comment.
RI
richardsfowler3 · 2 years ago

Included with the depth of the market you can see the current price volatility which measures the movement of pips on each incoming tick of data together with an audible alarm when a set threshold has been reached. To fully understand this algorithm, try to check this forex translation companies list created by Fazzaco.