Category Other  Published on 17/08/2022

Zoom With Mouse Wheel

Description

 

Zoom with Mouse Wheel for Ctrader 

This tool helps you zoom in / out  on the chart with the mouse wheel

be successful and profitable .

 

Copyright reserved for RTG trading group , 2022


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 ZoomByMouseWheel : Indicator
    {
      

        protected override void Initialize()
        {
           Chart.MouseWheel += Wheel;
         
           
        }
        
        
        public void Wheel(ChartMouseWheelEventArgs e)
        {
        
        if(e.Delta>0)
        {
        
       
         
        Chart.ZoomLevel =Convert.ToInt32(( Chart.ZoomLevel ) / 0.650);
        
        
        }
        else{
        
         
        Chart.ZoomLevel =Convert.ToInt32(( Chart.ZoomLevel ) * 0.650);
        
        
        }
       
        
        
        
        }

      



        public override void Calculate(int index)
        {
            // Calculate value at specified index
            // Result[index] = 
        }
    }
}

AM
amirbusinesstrade

Joined on 17.08.2022

  • Distribution: Free
  • Language: C#
  • Trading platform: cTrader Automate
  • File name: Zoom By Mouse Wheel.algo
  • Rating: 0
  • Installs: 1115
  • Modified: 17/08/2022 13:04
Comments
Log in to add a comment.
artcfd's avatar
artcfd · 2 years ago

The mouse has two scroll wheels, now the system itself can use the front of the mouse wheel to control the left and right movement, if the development of a function to let the left side of the mouse wheel used to control the zoom in and out would be good. Thanks.