Chart Interface Manager

by thoy1 in category Other at 04/10/2019
Description

Hi All,

Here is a simple Ease of Life Bot to improve your interface management. It's purpose is to simply zoom in and out without having to manually adjust your Y-scale.


4x Parameters

#1 - Top of Range - defines the Top Y-value of that you wish to make visible. ie. AUDNZD set to 1.12

#2 - Bottom of Range - defines the Bottom Y-value that you wish to make visible. ie. AUDNZD set to 1.0

#3 - Range of View Percent - defines the percentage of the range that you wish to see while zoomed in. ie. 15 = 15%

#4 - Follow Ask/Bid - setting to "1" will cause the Chart to continually centre around the Ask/Bid lines. Anything else will turn Following off.


When the Bot starts, the chart will zoom in to show only the percentage of the chart you have set.

When the Bot is stopped, the chart will zoom out to show the entire Y-range that you have set. ie AUDNZD 1.0 - 1.12

 

I hope some of you find this usefull.

Enjoy!

Thoy1

Download
89 downloads
How to install
Warning! Executing the following cBot may result in loss of funds. Use it at your own risk.
Notification Publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section you may use the Copyright Infringement Notification form to submit a claim.
Formula / Source Code
Language: C#
Trading Platform: cAlgo
using System;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;

namespace cAlgo.Robots
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class ChartZoomManager : Robot
    {
        [Parameter("Top of Range", DefaultValue = 1.18)]
        public double extremeHigh { get; set; }
        [Parameter("Bottom of Range", DefaultValue = 1.0)]
        public double extremeLow { get; set; }
        [Parameter("Range of View Percent", DefaultValue = 25)]
        public double rangePercentage { get; set; }
        [Parameter("Follow Ask/Bid? 1=On, 0=Off", DefaultValue = 1)]
        public double follow { get; set; }

        protected override void OnStart()
        {
            Chart.SetYRange(Symbol.Bid - ((extremeHigh - extremeLow) * (rangePercentage / 200)), Symbol.Bid + ((extremeHigh - extremeLow) * (rangePercentage / 200)));
        }

        protected override void OnTick()
        {
            if (follow == 1)
            {
                Chart.SetYRange(Symbol.Bid - ((extremeHigh - extremeLow) * (rangePercentage / 200)), Symbol.Bid + ((extremeHigh - extremeLow) * (rangePercentage / 200)));
            }
        }

        protected override void OnStop()
        {
            Chart.SetYRange(extremeLow - ((extremeHigh - extremeLow) * 0.1), extremeHigh + ((extremeHigh - extremeLow) * 0.1));
        }
    }
}
Comments
0