Currency Strength Meter (Pro) Ver2.02 free

by TheNiatpac in category Trend at 22/04/2022
Description
  • Group A / B to display 8 major currencies' strengths;
  • Import and display Economic Calendar's Key Events;
  • Align all indicators at a setting DateTime (Reset-Time-Point);
  • Shift+click scrolling to 15 minutes ahead of Reset-Time-Point;
  • Ctrl+click reset viewable Y-Range as settings;
  • Labels can display or hide Total Spread, Indicator Name and Value;
  • Apply to only TimeFrame by time;
  • Require access to your local file system.

 

Updates: (full logs please see source code)

  • v2.02 Optimise: Indicators calculation, Displaying of Label and Code Structure;

 

Notes:

  • Recommend USDJPY as BaseBar in the chart; 
    Zoom to 5% for TimeFrame.1Minute as an intraday view, 4Minute for one week view;
    Make sure to fill Reset-Time-Point within 1 or 2 days for an intraday view, within 5-10 days for one week view;
  • Economic KeyEvent's txt file in (GMT+1) time can be downloaded every week from the pinned message at Telegram Group: cTrader FOREX Club, you may find it very easy to modify by yourself;
  • If you use the group function to display indicators in 2 or more charts, highly recommend downloading Synchronized Crosshair ,  Synchronized Scrolling to work together. Both indicators are made by Spotware .

 

Screenshots:

This is a typical setting for intraday use (never mind about the background colour, it's another indicator's performance):

Where you can set file path for economic key events:

Don't forget to set a point of 'Reset Date-Time', and  adjust the viewable range when the market moves out of default setting:

Labels can display Total Spread, Indicator Name and Value, and hide them all by turning the 3 settings off.

Have Fun!

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: cAlgocTrader
using System;
using System.IO;
using cAlgo.API;
using cAlgo.API.Internals;

//v1.01 Basic function;
//v1.02 Add settings: Label Marker with Indicator Name;
//v1.03 Add settings: Fix Viewable Y-Range and Scroll to the ResetTimePoint;
//v1.04 Add settings: Display as Group A,B;
//v1.05 Add settings: Import Economic KeyEvents, Indicator Value to label;
//v1.06 Add settings: Switches of Labels to display Indicator Name and Value;
//v1.07 Add function: Hide BaseBars; Rewrite indicator calcuation;
//v1.08 Update func.: Scrolling to 15 minutes before the ResetTimePoint (AutoScrollPoint); 
//v1.09 Add settings: Y-Axis Gridline Gap (set 0 to hide); Viewable Y-Range set 0,0 to unlocking; 
//      Add function: Turn off both Indicator Name and Value to hide LabelMarker; Adjust Label format Indicator Value (+0.0 -0.0);
//v1.10 Optimise    : Indicators calculation and add 'Pips-Value' factor to the calculation of indicator value, based on GBP prices at ResetTimePoint;
//v1.11 Add settings: Label to display Total Spread of EachCurrency, and size the gap of LabelMarker by TotalSpreadValue;
//      Add function: Y-Axis Gridline Gap: 0 to disable chart scrolling;
//v2.01 Add function: Shit + MouseClick on chart to scroll to AutoScrollPoint;
//      Update func.: Reset Viewable Y-Range is effective when Y-Axis Gridline Gap > 0, 
//                    and triggered by launching the indicator or Ctrl + MouseClick on chart;
//      Optimise    : Displaying of Label, Calculation of TotalSpread (0.5 error); 
//v2.02 Optimise    : Indicators calculation, Displaying of Label and Code Structure;

namespace cAlgo
{
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.FileSystem)]
    public class CurrencyStrengthMeter : Indicator
    {
        // * * * * *  * * * * *  * * * * *  * * * * *  * * * * * Pro Version * * * * * *  * * * * *  * * * * *  * * * * *  * * * * * //
        [Parameter("Reset Date",            DefaultValue = "2030-12-31",                    Group = "Alignment"         )] public string ResetDate { get; set; }      //v.Basic
        [Parameter("Reset Time",            DefaultValue = "22:59:00",                      Group = "Alignment"         )] public string ResetTime { get; set; }      //v.Basic
        [Parameter("Viewable Range +",      DefaultValue =  450, Step = 50, MinValue =  0,  Group = "Ver. 2.02"         )] public double PVRange { get; set; }        //v.Pro
        [Parameter("Viewable Range -",      DefaultValue = -450, Step = 50, MaxValue =  0,  Group = "Ver. 2.02"         )] public double MVRange { get; set; }        //v.Pro
        [Parameter("Y-Gridline Gap",        DefaultValue =  200, Step = 50, MinValue =  0,  Group = "Ver. 2.02"         )] public int    YxisGap { get; set; }        //v.Pro
        [Parameter("GROUP A",               DefaultValue = "True",                          Group = "Group On/Off"      )] public bool   GroupA { get; set; }         //v.Basic
        [Parameter("GROUP B",               DefaultValue = "True",                          Group = "Group On/Off"      )] public bool   GroupB { get; set; }         //v.Basic
        [Parameter("KeyEvent FilePath:",    DefaultValue = @"C:\Events.txt",                Group = "Group On/Off"      )] public string flPath { get; set; }         //v.Pro
        [Parameter("Total Spread",          DefaultValue = "True",                          Group = "Label Content"     )] public bool   SprdSm { get; set; }         //v.Pro
        [Parameter("Currency Name",         DefaultValue = "True",                          Group = "Label Content"     )] public bool   NmMrkr { get; set; }         //v.Pro
        [Parameter("Indicator Value",       DefaultValue = "True",                          Group = "Label Content"     )] public bool   DiMrkr { get; set; }         //v.Pro
        // = = = = =  = = = = =  = = = = =  = = = = =  = = = = = Pro Version = = = = = =  = = = = =  = = = = =  = = = = =  = = = = = //



        // * * * * *  * * * * *  * * * * *  * * * * *  * * * * * Basic Version * * * * *  * * * * *  * * * * *  * * * * *  * * * * * //        
        [Output("USD", LineColor = "DDFF0005", Thickness = 2, PlotType = PlotType.DiscontinuousLine)] public IndicatorDataSeries USD { get; set; } private readonly Color cl_USD = Color.FromHex("DDFF0005");
        [Output("EUR", LineColor = "DD1256FF", Thickness = 2, PlotType = PlotType.DiscontinuousLine)] public IndicatorDataSeries EUR { get; set; } private readonly Color cl_EUR = Color.FromHex("DD1256FF");
        [Output("GBP", LineColor = "DDB600FF", Thickness = 2, PlotType = PlotType.DiscontinuousLine)] public IndicatorDataSeries GBP { get; set; } private readonly Color cl_GBP = Color.FromHex("DDB600FF");
        [Output("CHF", LineColor = "DDC4C425", Thickness = 2, PlotType = PlotType.DiscontinuousLine)] public IndicatorDataSeries CHF { get; set; } private readonly Color cl_CHF = Color.FromHex("DDC4C425");
        [Output("AUD", LineColor = "DDCFA005", Thickness = 2, PlotType = PlotType.DiscontinuousLine)] public IndicatorDataSeries AUD { get; set; } private readonly Color cl_AUD = Color.FromHex("DDCFA005");
        [Output("NZD", LineColor = "DD00BF00", Thickness = 2, PlotType = PlotType.DiscontinuousLine)] public IndicatorDataSeries NZD { get; set; } private readonly Color cl_NZD = Color.FromHex("DD00BF00");
        [Output("CAD", LineColor = "DDFF21BF", Thickness = 2, PlotType = PlotType.DiscontinuousLine)] public IndicatorDataSeries CAD { get; set; } private readonly Color cl_CAD = Color.FromHex("DDFF21BF");
        [Output("JPY", LineColor = "DDB3B3B3", Thickness = 2, PlotType = PlotType.DiscontinuousLine)] public IndicatorDataSeries JPY { get; set; } private readonly Color cl_JPY = Color.FromHex("DDB3B3B3");    
        //
        //Symbol Names
        private readonly string s_EURUSD = "EURUSD", s_EURGBP = "EURGBP", s_EURAUD = "EURAUD", s_EURNZD = "EURNZD", s_EURCAD = "EURCAD", s_EURCHF = "EURCHF", s_EURJPY = "EURJPY";
        private readonly string s_GBPUSD = "GBPUSD",                      s_GBPAUD = "GBPAUD", s_GBPNZD = "GBPNZD", s_GBPCAD = "GBPCAD", s_GBPCHF = "GBPCHF", s_GBPJPY = "GBPJPY";
        private readonly string s_AUDUSD = "AUDUSD",                                           s_AUDNZD = "AUDNZD", s_AUDCAD = "AUDCAD", s_AUDCHF = "AUDCHF", s_AUDJPY = "AUDJPY";
        private readonly string s_NZDUSD = "NZDUSD",                                                                s_NZDCAD = "NZDCAD", s_NZDCHF = "NZDCHF", s_NZDJPY = "NZDJPY";
        private readonly string s_USDCAD = "USDCAD",                                                                                     s_CADCHF = "CADCHF", s_CADJPY = "CADJPY";
        private readonly string s_USDCHF = "USDCHF",                                                                                                          s_CHFJPY = "CHFJPY";
        private readonly string s_USDJPY = "USDJPY";
        //
        //Bars to load for Calculate : Defined at Initialize() 
        private Bars EURUSD, EURGBP, EURAUD, EURNZD, EURCAD, EURCHF, EURJPY;        
        private Bars GBPUSD,         GBPAUD, GBPNZD, GBPCAD, GBPCHF, GBPJPY;
        private Bars AUDUSD,                 AUDNZD, AUDCAD, AUDCHF, AUDJPY;
        private Bars NZDUSD,                         NZDCAD, NZDCHF, NZDJPY;
        private Bars USDCAD,                                 CADCHF, CADJPY;
        private Bars USDCHF,                                         CHFJPY;
        private Bars USDJPY;
        //
        //Index at OpenTime of LastBar of EachSymbol : Defined at Initialize() & Calculate() 
        private int in_EURUSD, in_EURGBP, in_EURAUD, in_EURNZD, in_EURCAD, in_EURCHF, in_EURJPY;
        private int in_GBPUSD,            in_GBPAUD, in_GBPNZD, in_GBPCAD, in_GBPCHF, in_GBPJPY;
        private int in_AUDUSD,                       in_AUDNZD, in_AUDCAD, in_AUDCHF, in_AUDJPY;
        private int in_NZDUSD,                                  in_NZDCAD, in_NZDCHF, in_NZDJPY;
        private int in_USDCAD,                                             in_CADCHF, in_CADJPY;
        private int in_USDCHF,                                                        in_CHFJPY;
        private int in_USDJPY;
        //
        //OpenPrice at ResetTimePoint of EachSymbol : Defined at Initialize()
        private double db_EURUSD, db_EURGBP, db_EURAUD, db_EURNZD, db_EURCAD, db_EURCHF, db_EURJPY;
        private double db_GBPUSD,            db_GBPAUD, db_GBPNZD, db_GBPCAD, db_GBPCHF, db_GBPJPY;
        private double db_AUDUSD,                       db_AUDNZD, db_AUDCAD, db_AUDCHF, db_AUDJPY;
        private double db_NZDUSD,                                  db_NZDCAD, db_NZDCHF, db_NZDJPY;
        private double db_USDCAD,                                             db_CADCHF, db_CADJPY;
        private double db_USDCHF,                                                        db_CHFJPY;
        private double db_USDJPY;
        //
        //Parameters for Calculate Indicators : Defined at Initialize()
        private bool   b_BfrRstPnt = true;                              //Switch (True: return if index before AutoScroll TimePoint)
        private double mp_NJp = 10000, mp_YJp = 100;                    //Pips Decimal Convertor
        private double G_GBP, G_USD, G_AUD, G_NZD, G_CAD, G_CHF, G_JPY; //G_EUR: No symbol is priced by EUR; GBP Prices at ResetTimePoint: Defined at Initialize()
        //
        //Parameters for Displaysetting: Defined at Initialize() 
        private DateTime dt_RstPnt, dt_AtoScr; //Reset TimePoint, Auto-Scroll TimePoint;        
        // = = = = =  = = = = =  = = = = =  = = = = =  = = = = = Basic Version = = = = =  = = = = =  = = = = =  = = = = =  = = = = = //



        // * * * * *  * * * * *  * * * * *  * * * * *  * * * * * Pro Version * * * * * *  * * * * *  * * * * *  * * * * *  * * * * * //
        //Loading Messages
        private Color cl_LdnMsg = Color.FromHex("AAEEDDCC");    //Color of loading message,
        private ChartStaticText tx_Laod;                        //StaticText for loading, debugging etc.;
        //
        //Switches (GridLine & Label): Defined at Initialize()
        private bool b_YRange = true;                           //AutoSet ViewableY-Range: On as default;
        //GridLine NameFormat
        private readonly string fmt_Grd = "GL +0.0;-0.0;";
        private readonly Color cl_GrdLn0 = Color.FromHex("#40FFFFFF"), cl_GrdLnO = Color.FromHex("#55777777"); //Color for GridLine Zero and Others;
        //DrawKeyEvents
        private readonly string c_GrpA = "US UK CH EU DE FR IT SP", c_GrpB = "AU NZ CA JP";  //GroupA,B CountryCodes; And EachCurrency CountryCode
        private readonly string c_EA = "EU DE FR IT SP", c_US = "US", c_GB = "UK", c_CH = "CH", c_AU = "AU", c_NZ = "NZ", c_CA = "CA", c_JP = "JP"; 
        private readonly string pfx_EvnMkr = "EvntMkr-", pfx_EvnTxt = "EvntTxt-"; //Prefix for Envent's Marker and Text;
        //
        //Spread of EachSymbol : Defined at Calculate() 
        private double sp_EURUSD, sp_EURGBP, sp_EURAUD, sp_EURNZD, sp_EURCAD, sp_EURCHF, sp_EURJPY;
        private double sp_GBPUSD,            sp_GBPAUD, sp_GBPNZD, sp_GBPCAD, sp_GBPCHF, sp_GBPJPY;
        private double sp_AUDUSD,                       sp_AUDNZD, sp_AUDCAD, sp_AUDCHF, sp_AUDJPY;
        private double sp_NZDUSD,                                  sp_NZDCAD, sp_NZDCHF, sp_NZDJPY;
        private double sp_USDCAD,                                             sp_CADCHF, sp_CADJPY;
        private double sp_USDCHF,                                                        sp_CHFJPY;
        private double sp_USDJPY;
        private int    i_LblMkrLth;                                                 //Length of Label Marker;
        private double   S_EUR, S_GBP, S_USD, S_AUD, S_NZD, S_CAD, S_CHF, S_JPY;    //TotalSpread of EachCurrency : Defined at Calculate() 
        private string    m_US,  m_EU,  m_GB,  m_AU,  m_NZ,  m_CA,  m_CH,  m_JP;    //LabelText of CurrencyNames : Defined at Initialize()     
        private string    s_US,  s_EU,  s_GB,  s_AU,  s_NZ,  s_CA,  s_CH,  s_JP;    //LabelText of Total Spreads : Defined at Initialize(), Updated at Calculate() 
        private string    d_US,  d_EU,  d_GB,  d_AU,  d_NZ,  d_CA,  d_CH,  d_JP;    //LabelText of Digital-Value : Defined at Initialize(), Updated at Calculate() 
        private ChartText t_US,  t_EU,  t_GB,  t_AU,  t_NZ,  t_CA,  t_CH,  t_JP;    //LableText for EachCurrency (Both Front and Rear-Parts can use)
        private readonly string pfx_Lb = "LB_", pfx_Ut = "UT_", pfx_Lt = "LT_";     //Prefix of LabelFrontPartTextName, UpperTrendLineName, LowerTrendLineName
        private readonly string fmt_Sprd = "0.0  ", fmt_Idct = "  +0.0;  -0.0;";    //Format of TotalSpread, IndicatorValue
        private readonly string n_US ="USD", n_EU ="EUR", n_GB ="GBP", n_CH ="CHF", n_AU ="AUD", n_NZ ="NZD", n_CA ="CAD", n_JP ="JPY"; //Currency (Indicator) Name
        private bool            wf_EUR=true, wf_GBP=true, wf_AUD=true, wf_NZD=true, wf_USD=true, wf_CAD=true, wf_CHF=true, wf_JPY=true; //Switch for Label FrontPartText (On as default)
        // = = = = =  = = = = =  = = = = =  = = = = =  = = = = = Pro Version = = = = = =  = = = = =  = = = = =  = = = = =  = = = = = //
        


        protected override void Initialize()
        {
            // * * * * *  * * * * *  * * * * *  * * * * *  * * * * * Basic Version * * * * *  * * * * *  * * * * *  * * * * *  * * * * * //        
            //1.BasicParameters and Bars for EachSymbol
            dt_RstPnt = DateTime.Parse(ResetDate + " " + ResetTime).Add(-Application.UserTimeOffset); //Convert ResetTimePoint to ServerTime
            dt_AtoScr = dt_RstPnt.AddMinutes(-15);  //Calculate Auto-Scroll TimePoint (15 minutes before Reset-Time-Point)
            GetBarsForEachSymbols(Bars.TimeFrame);  //a.Load Bars for EachSymbol by Bar.TimeFrame        //
            UpdateSymbolsIndex(dt_RstPnt);          //b.Move Index (in_) to ResetTimePoint for EachSymbol//
            GetClosePricesAtResetPoint();           //c.Load ClosePrices of EachSymbols at ResetTimePoint//
            //
            //2.Get PipsValue-Ratio (to adjust contribution of price movement from EachSymbol), based on GBP prices at ResetTimePoint (G_EUR: No symbol is priced by EUR)
            G_GBP = 1; G_USD = 1/db_GBPUSD; G_AUD = 1/db_GBPAUD; G_NZD = 1/db_GBPNZD; G_CAD = 1/db_GBPCAD; G_CHF = 1/db_GBPCHF; G_JPY = 100/db_GBPJPY;
            //
            //3.Chart DisplaySettings
            Chart.ColorSettings.BullFillColor = Color.Transparent; Chart.ColorSettings.BullOutlineColor = Color.Transparent;    //Hide Bars(Bull) in Chart
            Chart.ColorSettings.BearFillColor = Color.Transparent; Chart.ColorSettings.BearOutlineColor = Color.Transparent;    //Hide Bars(Bear) in Chart    
            // = = = = =  = = = = =  = = = = =  = = = = =  = = = = = Basic Version = = = = =  = = = = =  = = = = =  = = = = =  = = = = = //


            
            // * * * * *  * * * * *  * * * * *  * * * * *  * * * * * Pro Version * * * * * *  * * * * *  * * * * *  * * * * *  * * * * * //
            //4.Chart Display (Don't Zoom, cause problem when loading LongTimeFrame Bars)
            b_YRange = ( MVRange!=0 && PVRange!=0 );                        //Viewable Y-Range ± (0/0 to Disable);
            if (File.Exists(flPath)) { DrawAllEvents(); }                   //Draw KeyEvent's Label of EachCurrency (Must after b_YRange Defined)
            if      (YxisGap >  0) { Chart.ScrollXTo(dt_AtoScr);            // > 0: Enable ResetTimePoint-Scrolling,
                 if (  b_YRange  ) { Chart.SetYRange(MVRange, PVRange); } } //      Reset Viewable Y-Range ± (0/0 to Disable);
            else if (YxisGap == 0) { Chart.IsScrollingEnabled = false;    } // = 0: Hide GridLines, Disable ChartScrolling, ResetTimePoint-Scrolling and Y-RangeReseting;
            else                   { YxisGap = 200;                       } // =-1: Set 200 as default GridLinesGap, Disable Chart Scrolling and Y-Range Reseting; (Useful to fix chart when IndicatorParameters change)
            ChartYGrid();                                                   //Draw Gridlines; 
            //5.Loading Message and Controls;
            string loadMsg = (YxisGap==0) ? "Chart Scrolling is disabled... " : "Ctrl + Click: Reset Y-Range;    Shift + Click: Scroll to Reset-Time-Point ... \n\n\n";                     
            tx_Laod = Chart.DrawStaticText("Loading", loadMsg, VerticalAlignment.Bottom, HorizontalAlignment.Center, cl_LdnMsg); //Draw LoadingMessage;
            Chart.MouseDown += Chart_MouseDown;     //Reset Viewable-YRange(Ctrl+Click), Scroll to ResetTimePoint(Shift+Click); Clear Loading Message;
            Chart.ZoomChanged += Chart_ZoomChanged; //Reset Length of LabelMarker
            //
            //6.Initialize Label(On,Off) Marker's Parameter and FrontPartText 
            DefineLabelMarkerLength();                                  //Define LabelMarkerLength: Zoom5% 12 bars, 15% 4 bars, 30% 2 bars, others 3 bars;
            int i = Bars.Count-1; LastBarsGroupA(i); LastBarsGroupB(i); //Update Indicators' value at LastBar (Bars.Count-1)
            if (NmMrkr) { m_US = n_US; m_EU = n_EU; m_GB = n_GB; m_CH = n_CH; m_AU = n_AU; m_NZ = n_NZ; m_CA = n_CA; m_JP = n_JP;} //a.Load Currencyss Name
            if (SprdSm) { UpdateSymbolsSpreads(); SpreadTextGroupA(); SpreadTextGroupB(); }         //b.Get Currencys' TotalSpread to LastBar
            if (DiMrkr) { ValueTextGroupA(i); ValueTextGroupB(i);                         }         //c.Get Currencys' TextValue to LastBar
            if ((NmMrkr||SprdSm||DiMrkr) && GroupA) { DrawLabelFstPrtGroupA(i, i+i_LblMkrLth); }    //d.Draw Lable's Marker and FrontPartText
            if ((NmMrkr||SprdSm||DiMrkr) && GroupB) { DrawLabelFstPrtGroupB(i, i+i_LblMkrLth); }    //d.Draw Lable's Marker and FrontPartText
            // = = = = =  = = = = =  = = = = =  = = = = =  = = = = = Pro Version = = = = = =  = = = = =  = = = = =  = = = = =  = = = = = //
            
        }



        public override void Calculate(int index)
        {
            //1.Calculation only start from AutoScroll Point
            if (b_BfrRstPnt) {if (Bars.OpenTimes[index] < dt_AtoScr) { return; } else { b_BfrRstPnt = false; } }                                    //Basic Version

            //2.Calculate LastBar
            if (IsLastBar)
            {
                if (GroupA)                                                     //GroupA: 
                {   LastBarsGroupA(index);                                      //  Calculate indicator value, at LastBarClose of relevant symbols  //Basic Version   
                    if (SprdSm) { UpdateSymbolsSpreads(); SpreadTextGroupA(); } //  Get TotalSpreads value and text for EachCurrency                // Pro  Version
                    if (DiMrkr) { ValueTextGroupA(index);                     } //  Get text of IndicatorValue for EachCurrency                     // pro  Version
                    DrawLabelFstPrtGroupA(index, index+i_LblMkrLth);            //  Update Labels for EachCurrency                                  // pro  Version
                }
                if (GroupB)                                                     //GroupB: 
                {   LastBarsGroupB(index);                                      //  Calculate indicator value, at LastBarClose of relevant symbols  //Basic Version
                    if (SprdSm) { UpdateSymbolsSpreads(); SpreadTextGroupB(); } //  Get TotalSpreads value and text for EachCurrency                // Pro  Version
                    if (DiMrkr) { ValueTextGroupB(index);                     } //  Get text of IndicatorValue for EachCurrency                     // pro  Version
                    DrawLabelFstPrtGroupB(index, index+i_LblMkrLth);            //  Update Labels for EachCurrency                                  // pro  Version
                }
            }
            //3.Calculate History Bars
            else
            {
                UpdateSymbolsIndex(Bars.OpenTimes[index]);  //Get HistoryBar's Index# for EachSymbols                                               //Basic Version
                if (GroupA) HistoryBarsGroupA(index);       //GroupA: Calculate indicator value, at HistoryBar of relevant symbols                  //Basic Version
                if (GroupB) HistoryBarsGroupB(index);       //GroupB: Calculate indicator value, at HistoryBar of relevant symbols                  //Basic Version
            }

        }



        // * * * * *  * * * * *  * * * * *  * * * * *  * * * * * Basic Version * * * * *  * * * * *  * * * * *  * * * * *  * * * * * //        
        //GetBars for EachSymbol 
        private void GetBarsForEachSymbols(TimeFrame timeFrame)
        {
            EURUSD = MarketData.GetBars(timeFrame, s_EURUSD);  GBPUSD = MarketData.GetBars(timeFrame, s_GBPUSD);  AUDUSD = MarketData.GetBars(timeFrame, s_AUDUSD);  NZDUSD = MarketData.GetBars(timeFrame, s_NZDUSD);
            EURGBP = MarketData.GetBars(timeFrame, s_EURGBP);  GBPAUD = MarketData.GetBars(timeFrame, s_GBPAUD);  AUDNZD = MarketData.GetBars(timeFrame, s_AUDNZD);  NZDCAD = MarketData.GetBars(timeFrame, s_NZDCAD);
            EURAUD = MarketData.GetBars(timeFrame, s_EURAUD);  GBPNZD = MarketData.GetBars(timeFrame, s_GBPNZD);  AUDCAD = MarketData.GetBars(timeFrame, s_AUDCAD);  NZDCHF = MarketData.GetBars(timeFrame, s_NZDCHF);
            EURNZD = MarketData.GetBars(timeFrame, s_EURNZD);  GBPCAD = MarketData.GetBars(timeFrame, s_GBPCAD);  AUDCHF = MarketData.GetBars(timeFrame, s_AUDCHF);  NZDJPY = MarketData.GetBars(timeFrame, s_NZDJPY);
            EURCAD = MarketData.GetBars(timeFrame, s_EURCAD);  GBPCHF = MarketData.GetBars(timeFrame, s_GBPCHF);  AUDJPY = MarketData.GetBars(timeFrame, s_AUDJPY);  
            EURCHF = MarketData.GetBars(timeFrame, s_EURCHF);  GBPJPY = MarketData.GetBars(timeFrame, s_GBPJPY);                                                     USDCAD = MarketData.GetBars(timeFrame, s_USDCAD);
            EURJPY = MarketData.GetBars(timeFrame, s_EURJPY);                                                     USDCHF = MarketData.GetBars(timeFrame, s_USDCHF);  CADCHF = MarketData.GetBars(timeFrame, s_CADCHF);
                                                               USDJPY = MarketData.GetBars(timeFrame, s_USDJPY);  CHFJPY = MarketData.GetBars(timeFrame, s_CHFJPY);  CADJPY = MarketData.GetBars(timeFrame, s_CADJPY);
        }
        //
        //Update Index for EachSymbol at a GivenDateTime (HistoryBars)
        private void UpdateSymbolsIndex(DateTime dateTime)
        {
            in_EURUSD = EURUSD.OpenTimes.GetIndexByTime(dateTime);  in_GBPUSD = GBPUSD.OpenTimes.GetIndexByTime(dateTime);  in_AUDUSD = AUDUSD.OpenTimes.GetIndexByTime(dateTime);  in_NZDUSD = NZDUSD.OpenTimes.GetIndexByTime(dateTime);
            in_EURGBP = EURGBP.OpenTimes.GetIndexByTime(dateTime);  in_GBPAUD = GBPAUD.OpenTimes.GetIndexByTime(dateTime);  in_AUDCAD = AUDCAD.OpenTimes.GetIndexByTime(dateTime);  in_NZDCAD = NZDCAD.OpenTimes.GetIndexByTime(dateTime);
            in_EURAUD = EURAUD.OpenTimes.GetIndexByTime(dateTime);  in_GBPCAD = GBPCAD.OpenTimes.GetIndexByTime(dateTime);  in_AUDNZD = AUDNZD.OpenTimes.GetIndexByTime(dateTime);  in_NZDCHF = NZDCHF.OpenTimes.GetIndexByTime(dateTime);
            in_EURCAD = EURCAD.OpenTimes.GetIndexByTime(dateTime);  in_GBPNZD = GBPNZD.OpenTimes.GetIndexByTime(dateTime);  in_AUDCHF = AUDCHF.OpenTimes.GetIndexByTime(dateTime);  in_NZDJPY = NZDJPY.OpenTimes.GetIndexByTime(dateTime);
            in_EURNZD = EURNZD.OpenTimes.GetIndexByTime(dateTime);  in_GBPCHF = GBPCHF.OpenTimes.GetIndexByTime(dateTime);  in_AUDJPY = AUDJPY.OpenTimes.GetIndexByTime(dateTime);
            in_EURCHF = EURCHF.OpenTimes.GetIndexByTime(dateTime);  in_GBPJPY = GBPJPY.OpenTimes.GetIndexByTime(dateTime);                                                          in_USDCAD = USDCAD.OpenTimes.GetIndexByTime(dateTime);
            in_EURJPY = EURJPY.OpenTimes.GetIndexByTime(dateTime);                                                          in_USDCHF = USDCHF.OpenTimes.GetIndexByTime(dateTime);  in_CADCHF = CADCHF.OpenTimes.GetIndexByTime(dateTime);
                                                                    in_USDJPY = USDJPY.OpenTimes.GetIndexByTime(dateTime);  in_CHFJPY = CHFJPY.OpenTimes.GetIndexByTime(dateTime);  in_CADJPY = CADJPY.OpenTimes.GetIndexByTime(dateTime);
        }
        //
        //Get ClosePrices of EachSymbols at ResetTimePoint
        private void GetClosePricesAtResetPoint()
        {
            db_EURUSD = EURUSD[in_EURUSD].Close; db_GBPUSD = GBPUSD[in_GBPUSD].Close; db_AUDUSD = AUDUSD[in_AUDUSD].Close; db_NZDUSD = NZDUSD[in_NZDUSD].Close;
            db_EURGBP = EURGBP[in_EURGBP].Close; db_GBPAUD = GBPAUD[in_GBPAUD].Close; db_AUDCAD = AUDCAD[in_AUDCAD].Close; db_NZDCAD = NZDCAD[in_NZDCAD].Close;
            db_EURAUD = EURAUD[in_EURAUD].Close; db_GBPCAD = GBPCAD[in_GBPCAD].Close; db_AUDNZD = AUDNZD[in_AUDNZD].Close; db_NZDCHF = NZDCHF[in_NZDCHF].Close;
            db_EURCAD = EURCAD[in_EURCAD].Close; db_GBPNZD = GBPNZD[in_GBPNZD].Close; db_AUDCHF = AUDCHF[in_AUDCHF].Close; db_NZDJPY = NZDJPY[in_NZDJPY].Close;
            db_EURNZD = EURNZD[in_EURNZD].Close; db_GBPCHF = GBPCHF[in_GBPCHF].Close; db_AUDJPY = AUDJPY[in_AUDJPY].Close;                                     
            db_EURCHF = EURCHF[in_EURCHF].Close; db_GBPJPY = GBPJPY[in_GBPJPY].Close;                                      db_USDCAD = USDCAD[in_USDCAD].Close;
            db_EURJPY = EURJPY[in_EURJPY].Close;                                      db_USDCHF = USDCHF[in_USDCHF].Close; db_CADCHF = CADCHF[in_CADCHF].Close;
                                                 db_USDJPY = USDJPY[in_USDJPY].Close; db_CHFJPY = CHFJPY[in_CHFJPY].Close; db_CADJPY = CADJPY[in_CADJPY].Close;
        }
        //
        //Update Indicator-History-Value 
        private void HistoryBarsGroupA(int idx) //[Group A]
        {
            EUR[idx] = ( ( (EURUSD[in_EURUSD].Close-db_EURUSD)*G_USD + (EURGBP[in_EURGBP].Close-db_EURGBP)*G_GBP + (EURAUD[in_EURAUD].Close-db_EURAUD)*G_AUD + (EURNZD[in_EURNZD].Close-db_EURNZD)*G_NZD + (EURCAD[in_EURCAD].Close-db_EURCAD)*G_CAD + (EURCHF[in_EURCHF].Close-db_EURCHF)*G_CHF ) * mp_NJp + ( (EURJPY[in_EURJPY].Close-db_EURJPY)*G_JPY ) * mp_YJp );
            GBP[idx] = ( ( (db_EURGBP-EURGBP[in_EURGBP].Close)*G_GBP + (GBPAUD[in_GBPAUD].Close-db_GBPAUD)*G_AUD + (GBPNZD[in_GBPNZD].Close-db_GBPNZD)*G_NZD + (GBPUSD[in_GBPUSD].Close-db_GBPUSD)*G_USD + (GBPCAD[in_GBPCAD].Close-db_GBPCAD)*G_CAD + (GBPCHF[in_GBPCHF].Close-db_GBPCHF)*G_CHF ) * mp_NJp + ( (GBPJPY[in_GBPJPY].Close-db_GBPJPY)*G_JPY ) * mp_YJp );
            USD[idx] = ( ( (db_EURUSD-EURUSD[in_EURUSD].Close)*G_USD + (db_GBPUSD-GBPUSD[in_GBPUSD].Close)*G_USD + (db_AUDUSD-AUDUSD[in_AUDUSD].Close)*G_USD + (db_NZDUSD-NZDUSD[in_NZDUSD].Close)*G_USD + (USDCAD[in_USDCAD].Close-db_USDCAD)*G_CAD + (USDCHF[in_USDCHF].Close-db_USDCHF)*G_CHF ) * mp_NJp + ( (USDJPY[in_USDJPY].Close-db_USDJPY)*G_JPY ) * mp_YJp );
            CHF[idx] = ( ( (db_EURCHF-EURCHF[in_EURCHF].Close)*G_CHF + (db_GBPCHF-GBPCHF[in_GBPCHF].Close)*G_CHF + (db_AUDCHF-AUDCHF[in_AUDCHF].Close)*G_CHF + (db_NZDCHF-NZDCHF[in_NZDCHF].Close)*G_CHF + (db_USDCHF-USDCHF[in_USDCHF].Close)*G_CHF + (db_CADCHF-CADCHF[in_CADCHF].Close)*G_CHF ) * mp_NJp + ( (CHFJPY[in_CHFJPY].Close-db_CHFJPY)*G_JPY ) * mp_YJp );
        }
        private void HistoryBarsGroupB(int idx) //[Group B]
        {
            AUD[idx] = ( ( (db_EURAUD-EURAUD[in_EURAUD].Close)*G_AUD + (db_GBPAUD-GBPAUD[in_GBPAUD].Close)*G_AUD + (AUDNZD[in_AUDNZD].Close-db_AUDNZD)*G_NZD + (AUDUSD[in_AUDUSD].Close-db_AUDUSD)*G_USD + (AUDCAD[in_AUDCAD].Close-db_AUDCAD)*G_CAD + (AUDCHF[in_AUDCHF].Close-db_AUDCHF)*G_CHF ) * mp_NJp + ( (AUDJPY[in_AUDJPY].Close-db_AUDJPY)*G_JPY ) * mp_YJp );
            NZD[idx] = ( ( (db_EURNZD-EURNZD[in_EURNZD].Close)*G_NZD + (db_GBPNZD-GBPNZD[in_GBPNZD].Close)*G_NZD + (db_AUDNZD-AUDNZD[in_AUDNZD].Close)*G_NZD + (NZDUSD[in_NZDUSD].Close-db_NZDUSD)*G_USD + (NZDCAD[in_NZDCAD].Close-db_NZDCAD)*G_CAD + (NZDCHF[in_NZDCHF].Close-db_NZDCHF)*G_CHF ) * mp_NJp + ( (NZDJPY[in_NZDJPY].Close-db_NZDJPY)*G_JPY ) * mp_YJp );
            CAD[idx] = ( ( (db_EURCAD-EURCAD[in_EURCAD].Close)*G_CAD + (db_GBPCAD-GBPCAD[in_GBPCAD].Close)*G_CAD + (db_AUDCAD-AUDCAD[in_AUDCAD].Close)*G_CAD + (db_NZDCAD-NZDCAD[in_NZDCAD].Close)*G_CAD + (db_USDCAD-USDCAD[in_USDCAD].Close)*G_CAD + (CADCHF[in_CADCHF].Close-db_CADCHF)*G_CHF ) * mp_NJp + ( (CADJPY[in_CADJPY].Close-db_CADJPY)*G_JPY ) * mp_YJp );
            JPY[idx] = ( ( (db_EURJPY-EURJPY[in_EURJPY].Close)*G_JPY + (db_GBPJPY-GBPJPY[in_GBPJPY].Close)*G_JPY + (db_AUDJPY-AUDJPY[in_AUDJPY].Close)*G_JPY + (db_NZDJPY-NZDJPY[in_NZDJPY].Close)*G_JPY + (db_USDJPY-USDJPY[in_USDJPY].Close)*G_JPY + (db_CADJPY-CADJPY[in_CADJPY].Close)*G_JPY +              (db_CHFJPY-CHFJPY[in_CHFJPY].Close)*G_JPY ) * mp_YJp );
        }
        //
        //Update INdicator-CloseTick-Value 
        private void LastBarsGroupA(int idx)    //[Group A]
        {
            EUR[idx] = ( ( (EURUSD.LastBar.Close-db_EURUSD)*G_USD + (EURGBP.LastBar.Close-db_EURGBP)*G_GBP + (EURAUD.LastBar.Close-db_EURAUD)*G_AUD + (EURNZD.LastBar.Close-db_EURNZD)*G_NZD + (EURCAD.LastBar.Close-db_EURCAD)*G_CAD + (EURCHF.LastBar.Close-db_EURCHF)*G_CHF ) * mp_NJp + ( (EURJPY.LastBar.Close-db_EURJPY)*G_JPY ) * mp_YJp );
            GBP[idx] = ( ( (db_EURGBP-EURGBP.LastBar.Close)*G_GBP + (GBPAUD.LastBar.Close-db_GBPAUD)*G_AUD + (GBPNZD.LastBar.Close-db_GBPNZD)*G_NZD + (GBPUSD.LastBar.Close-db_GBPUSD)*G_USD + (GBPCAD.LastBar.Close-db_GBPCAD)*G_CAD + (GBPCHF.LastBar.Close-db_GBPCHF)*G_CHF ) * mp_NJp + ( (GBPJPY.LastBar.Close-db_GBPJPY)*G_JPY ) * mp_YJp );
            USD[idx] = ( ( (db_EURUSD-EURUSD.LastBar.Close)*G_USD + (db_GBPUSD-GBPUSD.LastBar.Close)*G_USD + (db_AUDUSD-AUDUSD.LastBar.Close)*G_USD + (db_NZDUSD-NZDUSD.LastBar.Close)*G_USD + (USDCAD.LastBar.Close-db_USDCAD)*G_CAD + (USDCHF.LastBar.Close-db_USDCHF)*G_CHF ) * mp_NJp + ( (USDJPY.LastBar.Close-db_USDJPY)*G_JPY ) * mp_YJp );
            CHF[idx] = ( ( (db_EURCHF-EURCHF.LastBar.Close)*G_CHF + (db_GBPCHF-GBPCHF.LastBar.Close)*G_CHF + (db_AUDCHF-AUDCHF.LastBar.Close)*G_CHF + (db_NZDCHF-NZDCHF.LastBar.Close)*G_CHF + (db_USDCHF-USDCHF.LastBar.Close)*G_CHF + (db_CADCHF-CADCHF.LastBar.Close)*G_CHF ) * mp_NJp + ( (CHFJPY.LastBar.Close-db_CHFJPY)*G_JPY ) * mp_YJp );
        }
        private void LastBarsGroupB(int idx)    //[Group B]
        {
            AUD[idx] = ( ( (db_EURAUD-EURAUD.LastBar.Close)*G_AUD + (db_GBPAUD-GBPAUD.LastBar.Close)*G_AUD + (AUDNZD.LastBar.Close-db_AUDNZD)*G_NZD + (AUDUSD.LastBar.Close-db_AUDUSD)*G_USD + (AUDCAD.LastBar.Close-db_AUDCAD)*G_CAD + (AUDCHF.LastBar.Close-db_AUDCHF)*G_CHF ) * mp_NJp + ( (AUDJPY.LastBar.Close-db_AUDJPY)*G_JPY ) * mp_YJp );
            NZD[idx] = ( ( (db_EURNZD-EURNZD.LastBar.Close)*G_NZD + (db_GBPNZD-GBPNZD.LastBar.Close)*G_NZD + (db_AUDNZD-AUDNZD.LastBar.Close)*G_NZD + (NZDUSD.LastBar.Close-db_NZDUSD)*G_USD + (NZDCAD.LastBar.Close-db_NZDCAD)*G_CAD + (NZDCHF.LastBar.Close-db_NZDCHF)*G_CHF ) * mp_NJp + ( (NZDJPY.LastBar.Close-db_NZDJPY)*G_JPY ) * mp_YJp );
            CAD[idx] = ( ( (db_EURCAD-EURCAD.LastBar.Close)*G_CAD + (db_GBPCAD-GBPCAD.LastBar.Close)*G_CAD + (db_AUDCAD-AUDCAD.LastBar.Close)*G_CAD + (db_NZDCAD-NZDCAD.LastBar.Close)*G_CAD + (db_USDCAD-USDCAD.LastBar.Close)*G_CAD + (CADCHF.LastBar.Close-db_CADCHF)*G_CHF ) * mp_NJp + ( (CADJPY.LastBar.Close-db_CADJPY)*G_JPY ) * mp_YJp );
            JPY[idx] = ( ( (db_EURJPY-EURJPY.LastBar.Close)*G_JPY + (db_GBPJPY-GBPJPY.LastBar.Close)*G_JPY + (db_AUDJPY-AUDJPY.LastBar.Close)*G_JPY + (db_NZDJPY-NZDJPY.LastBar.Close)*G_JPY + (db_USDJPY-USDJPY.LastBar.Close)*G_JPY + (db_CADJPY-CADJPY.LastBar.Close)*G_JPY +              (db_CHFJPY-CHFJPY.LastBar.Close)*G_JPY ) * mp_YJp );
        }        
        // = = = = =  = = = = =  = = = = =  = = = = =  = = = = = Basic Version = = = = =  = = = = =  = = = = =  = = = = =  = = = = = //



        // * * * * *  * * * * *  * * * * *  * * * * *  * * * * * Pro Version * * * * * *  * * * * *  * * * * *  * * * * *  * * * * * //
        //Draw Horizental Line: Chart Y-Grid    <Ini.>
        private void ChartYGrid()
        {
            if  (YxisGap <= 0) { return; } //Hide GridLines
            for (int i = 0; i <= 3000; i += YxisGap) 
            { 
                Chart.DrawHorizontalLine( ( i).ToString(fmt_Grd),  i,                cl_GrdLnO, 1,                      LineStyle.Dots );
                Chart.DrawHorizontalLine( (-i).ToString(fmt_Grd), -i, i==0?cl_GrdLn0:cl_GrdLnO, 1, i==0?LineStyle.Solid:LineStyle.Dots );
            }
        }
        //
        //Draw All KeyEvents Labels in Chart (According Group A,B)  <Ini.>
        private void DrawAllEvents()
        {
            foreach (string line in File.ReadLines(flPath))   //Load EachLine of txt file
            { 
                string[] events = line.Split(','); 
                bool GroupEvent = (GroupA && c_GrpA.Contains(events[2])) || (GroupB && c_GrpB.Contains(events[2])); //Check Country Code
                if ( GroupEvent ) { DrawOneEvnt(events[0], events[1], events[2], events[3], events[4]); } 
            }
        }
        //Draw One KeyEvent's Label in Chart
        private void DrawOneEvnt(string dt_Date, string tm_Time, string ct_Cnty, string et_Evnt, string et_Ent2)
        {
            DateTime parsedDateTime = DateTime.Parse(dt_Date + " " + tm_Time).Add(-Application.UserTimeOffset); //Get Event's ServerTime
            string tx_Name = string.Format("{0} {1}: {2} - {3}", dt_Date, tm_Time, ct_Cnty, et_Evnt);           //Event's Name with user's time
            string tx_Ctnt = string.Format("{0} {1} \n{2} \n{3}", tm_Time, ct_Cnty, et_Evnt, et_Ent2);          //Event's Content with user's time

            Color cl_Mkr = Color.Transparent, cl_Txt = Color.Transparent;   //Color for Keyvents Marker and Text
            VerticalAlignment EvntTxtVA = VerticalAlignment.Bottom;         //Event's Text VerticalAlignment default at Bottom
            double db_YUpr = 400, db_YDwn = -400, db_YVal = 0;              //Default Upper,Lower value for TrendLineEnd and Text; Actual Y-value to draw;
            if (b_YRange) { db_YUpr = PVRange*0.9; db_YDwn = MVRange*0.9; } //Autoadjust to Y-ViewableRange Settings
            if (c_EA.Contains(ct_Cnty)) { cl_Mkr = Color.FromArgb(120, cl_EUR); cl_Txt = Color.FromArgb(180, cl_EUR); db_YVal = db_YDwn; EvntTxtVA = VerticalAlignment.Top; }
            else if (ct_Cnty == c_US)   { cl_Mkr = Color.FromArgb(120, cl_USD); cl_Txt = Color.FromArgb(180, cl_USD); db_YVal = db_YUpr; } 
            else if (ct_Cnty == c_GB)   { cl_Mkr = Color.FromArgb(120, cl_GBP); cl_Txt = Color.FromArgb(180, cl_GBP); db_YVal = db_YUpr; }
            else if (ct_Cnty == c_CH)   { cl_Mkr = Color.FromArgb(120, cl_CHF); cl_Txt = Color.FromArgb(180, cl_CHF); db_YVal = db_YDwn; EvntTxtVA = VerticalAlignment.Top; }
            else if (ct_Cnty == c_AU)   { cl_Mkr = Color.FromArgb(120, cl_AUD); cl_Txt = Color.FromArgb(180, cl_AUD); db_YVal = db_YUpr; }
            else if (ct_Cnty == c_NZ)   { cl_Mkr = Color.FromArgb(120, cl_NZD); cl_Txt = Color.FromArgb(180, cl_NZD); db_YVal = db_YUpr; }
            else if (ct_Cnty == c_CA)   { cl_Mkr = Color.FromArgb(120, cl_CAD); cl_Txt = Color.FromArgb(180, cl_CAD); db_YVal = db_YDwn; EvntTxtVA = VerticalAlignment.Top; }
            else if (ct_Cnty == c_JP)   { cl_Mkr = Color.FromArgb(120, cl_JPY); cl_Txt = Color.FromArgb(180, cl_JPY); db_YVal = db_YDwn; EvntTxtVA = VerticalAlignment.Top; }

            //Draw TimeLine Marker
            Chart.DrawTrendLine(pfx_EvnMkr + tx_Name, parsedDateTime, 0, parsedDateTime, db_YVal, cl_Mkr, 1, LineStyle.Solid);
            //Draw TextBox Content, set VerticalAlignment anchor according CountryCode
            ChartText tx_Events = Chart.DrawText(pfx_EvnTxt + tx_Name, tx_Ctnt, parsedDateTime, db_YVal, cl_Txt); tx_Events.VerticalAlignment = EvntTxtVA;
        }
        //
        //ChartControl  - ClickMouse
        private void Chart_MouseDown(ChartMouseEventArgs obj)
        {
            tx_Laod.Text = string.Empty;    Calculate(Bars.Count-1);                //Clear Loading Message, Update Indicators manually(Count-1=Last);
            if ( obj.CtrlKey && b_YRange) { Chart.SetYRange(MVRange, PVRange); }    //Ctrl : Reset ViewableRange according to settings;
            if ( obj.ShiftKey )           { Chart.ScrollXTo(dt_AtoScr);        }    //Shift: Scroll to ResetTimePoint;
        }
        //              - ZoomChange
        private void Chart_ZoomChanged(ChartZoomEventArgs obj) 
        { 
            DefineLabelMarkerLength(); 
        }
        //
        //Defeine Length of LabelMarker according ZoomLevel
        private void DefineLabelMarkerLength() 
        {   
            int zm = Chart.ZoomLevel; 
            i_LblMkrLth = zm == 5 ? 12 : zm == 15 ? 4 : zm >= 30 ? 2 : 3; //Define LabelMarkerLength: Zoom5% 12 bars, 15% 4 bars, 30% 2 bars, others 3 bars;
        }
        //
        //Get Spreads for EachSymbol, Defined: Calculate(IsLastBar)
        private void UpdateSymbolsSpreads()
        {
            sp_EURUSD = mp_NJp * Symbols.GetSymbol(s_EURUSD).Spread; sp_GBPUSD = mp_NJp * Symbols.GetSymbol(s_GBPUSD).Spread; sp_AUDUSD = mp_NJp * Symbols.GetSymbol(s_AUDUSD).Spread; sp_NZDUSD = mp_NJp * Symbols.GetSymbol(s_NZDUSD).Spread;
            sp_EURGBP = mp_NJp * Symbols.GetSymbol(s_EURGBP).Spread; sp_GBPAUD = mp_NJp * Symbols.GetSymbol(s_GBPAUD).Spread; sp_AUDCAD = mp_NJp * Symbols.GetSymbol(s_AUDCAD).Spread; sp_NZDCAD = mp_NJp * Symbols.GetSymbol(s_NZDCAD).Spread;
            sp_EURAUD = mp_NJp * Symbols.GetSymbol(s_EURAUD).Spread; sp_GBPCAD = mp_NJp * Symbols.GetSymbol(s_GBPCAD).Spread; sp_AUDNZD = mp_NJp * Symbols.GetSymbol(s_AUDNZD).Spread; sp_NZDCHF = mp_NJp * Symbols.GetSymbol(s_NZDCHF).Spread;
            sp_EURCAD = mp_NJp * Symbols.GetSymbol(s_EURCAD).Spread; sp_GBPNZD = mp_NJp * Symbols.GetSymbol(s_GBPNZD).Spread; sp_AUDCHF = mp_NJp * Symbols.GetSymbol(s_AUDCHF).Spread; sp_NZDJPY = mp_YJp * Symbols.GetSymbol(s_NZDJPY).Spread;
            sp_EURNZD = mp_NJp * Symbols.GetSymbol(s_EURNZD).Spread; sp_GBPCHF = mp_NJp * Symbols.GetSymbol(s_GBPCHF).Spread; sp_AUDJPY = mp_YJp * Symbols.GetSymbol(s_AUDJPY).Spread;
            sp_EURCHF = mp_NJp * Symbols.GetSymbol(s_EURCHF).Spread; sp_GBPJPY = mp_YJp * Symbols.GetSymbol(s_GBPJPY).Spread;                                                          sp_USDCAD = mp_NJp * Symbols.GetSymbol(s_USDCAD).Spread;
            sp_EURJPY = mp_YJp * Symbols.GetSymbol(s_EURJPY).Spread;                                                          sp_USDCHF = mp_NJp * Symbols.GetSymbol(s_USDCHF).Spread; sp_CADCHF = mp_NJp * Symbols.GetSymbol(s_CADCHF).Spread;
                                                                     sp_USDJPY = mp_YJp * Symbols.GetSymbol(s_USDJPY).Spread; sp_CHFJPY = mp_YJp * Symbols.GetSymbol(s_CHFJPY).Spread; sp_CADJPY = mp_YJp * Symbols.GetSymbol(s_CADJPY).Spread;
        }
        //Get TotalSpreads for EachCurrency and convert to string
        private void SpreadTextGroupA() //[Group A]
        {
            S_USD = sp_EURUSD + sp_GBPUSD + sp_AUDUSD + sp_USDCAD + sp_NZDUSD + sp_USDCHF + sp_USDJPY; s_US = S_USD.ToString(fmt_Sprd);
            S_EUR = sp_EURUSD + sp_EURGBP + sp_EURAUD + sp_EURCAD + sp_EURNZD + sp_EURCHF + sp_EURJPY; s_EU = S_EUR.ToString(fmt_Sprd);
            S_GBP = sp_EURGBP + sp_GBPUSD + sp_GBPAUD + sp_GBPCAD + sp_GBPNZD + sp_GBPCHF + sp_GBPJPY; s_GB = S_GBP.ToString(fmt_Sprd);
            S_CHF = sp_EURCHF + sp_GBPCHF + sp_AUDCHF + sp_USDCHF + sp_NZDCHF + sp_CADCHF + sp_CHFJPY; s_CH = S_CHF.ToString(fmt_Sprd);
        }
        private void SpreadTextGroupB() //[Group B]
        {
            S_AUD = sp_EURAUD + sp_GBPAUD + sp_AUDNZD + sp_AUDUSD + sp_AUDCAD + sp_AUDCHF + sp_AUDJPY; s_AU = S_AUD.ToString(fmt_Sprd);
            S_NZD = sp_EURNZD + sp_GBPNZD + sp_AUDNZD + sp_NZDUSD + sp_NZDCAD + sp_NZDCHF + sp_NZDJPY; s_NZ = S_NZD.ToString(fmt_Sprd);
            S_CAD = sp_EURCAD + sp_GBPCAD + sp_AUDCAD + sp_NZDCAD + sp_USDCAD + sp_CADCHF + sp_CADJPY; s_CA = S_CAD.ToString(fmt_Sprd);
            S_JPY = sp_EURJPY + sp_GBPJPY + sp_AUDJPY + sp_USDJPY + sp_NZDJPY + sp_CADJPY + sp_CHFJPY; s_JP = S_JPY.ToString(fmt_Sprd);
        }
        //
        //Get IndicatorValue for EachCurrency and convert to string
        private void ValueTextGroupA(int idx)  //[Group A]
        {
            d_US = USD[idx].ToString(fmt_Idct);
            d_EU = EUR[idx].ToString(fmt_Idct);
            d_GB = GBP[idx].ToString(fmt_Idct);
            d_CH = CHF[idx].ToString(fmt_Idct);
        }
        private void ValueTextGroupB(int idx)  //[Group B]
        {
            d_AU = AUD[idx].ToString(fmt_Idct);
            d_NZ = NZD[idx].ToString(fmt_Idct);
            d_CA = CAD[idx].ToString(fmt_Idct);
            d_JP = JPY[idx].ToString(fmt_Idct);
        }
        //
        //Draw Label's Marker and FrontPartText (TotalSpread, CurrencyName, IndicatorValue with indivicual switch)
        private void DrawLabelFstPrtGroupA(int idx, int idxx)   //[Group A]
        {   
            if (wf_USD)
            {
                Chart.DrawTrendLine(pfx_Ut+n_US, idx, USD.LastValue, idxx, USD.LastValue+S_USD/2, cl_USD);  //USD's UpperLine
                Chart.DrawTrendLine(pfx_Lt+n_US, idx, USD.LastValue, idxx, USD.LastValue-S_USD/2, cl_USD);  //USD's LowerLine
                t_US = Chart.DrawText(pfx_Lb+n_US, s_US+m_US+d_US, idxx, USD.LastValue, cl_USD);            //USD's FrontPartText
                t_US.VerticalAlignment = VerticalAlignment.Center;
            }
            if (wf_EUR)
            {
                Chart.DrawTrendLine(pfx_Ut+n_EU, idx, EUR.LastValue, idxx, EUR.LastValue+S_EUR/2, cl_EUR);  //EUR's UpperLine
                Chart.DrawTrendLine(pfx_Lt+n_EU, idx, EUR.LastValue, idxx, EUR.LastValue-S_EUR/2, cl_EUR);  //EUR's LowerLine
                t_EU = Chart.DrawText(pfx_Lb+n_EU, s_EU+m_EU+d_EU, idxx, EUR.LastValue, cl_EUR);            //EUR's FrontPartText
                t_EU.VerticalAlignment = VerticalAlignment.Center;
            }
            if (wf_GBP)
            {
                Chart.DrawTrendLine(pfx_Ut+n_GB, idx, GBP.LastValue, idxx, GBP.LastValue+S_GBP/2, cl_GBP);  //GBP's UpperLine
                Chart.DrawTrendLine(pfx_Lt+n_GB, idx, GBP.LastValue, idxx, GBP.LastValue-S_GBP/2, cl_GBP);  //GBP's LowerLine
                t_GB = Chart.DrawText(pfx_Lb+n_GB, s_GB+m_GB+d_GB, idxx, GBP.LastValue, cl_GBP);            //GBP's FrontPartText
                t_GB.VerticalAlignment = VerticalAlignment.Center;
            }
            if (wf_CHF)
            {
                Chart.DrawTrendLine(pfx_Ut+n_CH, idx, CHF.LastValue, idxx, CHF.LastValue+S_CHF/2, cl_CHF);  //CHF's UpperLine
                Chart.DrawTrendLine(pfx_Lt+n_CH, idx, CHF.LastValue, idxx, CHF.LastValue-S_CHF/2, cl_CHF);  //CHF's LowerLine
                t_CH = Chart.DrawText(pfx_Lb+n_CH, s_CH+m_CH+d_CH, idxx, CHF.LastValue, cl_CHF);            //CHF's FrontPartText
                t_CH.VerticalAlignment = VerticalAlignment.Center;
            }
        }
        private void DrawLabelFstPrtGroupB(int idx, int idxx)   //[Group B]
        {   
            if (wf_AUD)
            {
                Chart.DrawTrendLine(pfx_Ut+n_AU, idx, AUD.LastValue, idxx, AUD.LastValue+S_AUD/2, cl_AUD);  //AUD's UpperLine
                Chart.DrawTrendLine(pfx_Lt+n_AU, idx, AUD.LastValue, idxx, AUD.LastValue-S_AUD/2, cl_AUD);  //AUD's LowerLine
                t_AU = Chart.DrawText(pfx_Lb+n_AU, s_AU+m_AU+d_AU, idxx, AUD.LastValue, cl_AUD);            //AUD's FrontPartText
                t_AU.VerticalAlignment = VerticalAlignment.Center;
            }
            if (wf_NZD)
            {
                Chart.DrawTrendLine(pfx_Ut+n_NZ, idx, NZD.LastValue, idxx, NZD.LastValue+S_NZD/2, cl_NZD);  //NZD's UpperLine
                Chart.DrawTrendLine(pfx_Lt+n_NZ, idx, NZD.LastValue, idxx, NZD.LastValue-S_NZD/2, cl_NZD);  //NZD's LowerLine
                t_NZ = Chart.DrawText(pfx_Lb+n_NZ, s_NZ+m_NZ+d_NZ, idxx, NZD.LastValue, cl_NZD);            //NZD's FrontPartText
                t_NZ.VerticalAlignment = VerticalAlignment.Center;
            }
            if (wf_CAD)
            {
                Chart.DrawTrendLine(pfx_Ut+n_CA, idx, CAD.LastValue, idxx, CAD.LastValue+S_CAD/2, cl_CAD);  //CAD's UpperLine
                Chart.DrawTrendLine(pfx_Lt+n_CA, idx, CAD.LastValue, idxx, CAD.LastValue-S_CAD/2, cl_CAD);  //CAD's LowerLine
                t_CA = Chart.DrawText(pfx_Lb+n_CA, s_CA+m_CA+d_CA, idxx, CAD.LastValue, cl_CAD);            //CAD's FrontPartText
                t_CA.VerticalAlignment = VerticalAlignment.Center;
            }
            if (wf_JPY)
            {
                Chart.DrawTrendLine(pfx_Ut+n_JP, idx, JPY.LastValue, idxx, JPY.LastValue+S_JPY/2, cl_JPY);  //JPY's UpperLine
                Chart.DrawTrendLine(pfx_Lt+n_JP, idx, JPY.LastValue, idxx, JPY.LastValue-S_JPY/2, cl_JPY);  //JPY's LowerLine
                t_JP = Chart.DrawText(pfx_Lb+n_JP, s_JP+m_JP+d_JP, idxx, JPY.LastValue, cl_JPY);            //JPY's FrontPartText
                t_JP.VerticalAlignment = VerticalAlignment.Center;
            }
        }
        // = = = = =  = = = = =  = = = = =  = = = = =  = = = = = Pro Version = = = = = =  = = = = =  = = = = =  = = = = =  = = = = = //


    }

}
Comments

fxctrader - April 22, 2022 @ 06:44

https://ibb.co/873LcFc

is it possible to add the currency name on the side to make it easy or quickly glance which currency is gaining strength?

 

fxctrader - April 22, 2022 @ 06:45

Name on the right side

is it possible to add the currency name on the side to make it easy or quickly glance which currency is gaining strength?

TheNiatpac - April 22, 2022 @ 12:37

Updated to v1.06:  Add CurrencyName to indicator cursor, User control whether to show digitals or name;

TheNiatpac - April 23, 2022 @ 16:38

v1.07  Rewrite indicator calculation, Y-Axis range, and autohide base bars; (Reloading is more quickly when adjusting viewable range)

TheNiatpac - April 25, 2022 @ 12:15

  • v1.08  Auto-scroll to two trading hours before Reset-Time-Point;

TheNiatpac - April 28, 2022 @ 00:21

  • v1.10 Improve calculation and efficiency, (add 'pips-value' factor to the results according to base currency), optimise chart view settings;
  • v1.09 Reformat marker's value (+0.0 -0.0), hide pointer when Digitals and Name both off; Y-range can be auto-arranged if set to 0/0; Y-Axis Gridline can be set off;

TheNiatpac - April 30, 2022 @ 02:46

  • v1.11 Label can show or (set to 0) hide the spread sum of relevant symbols, and also displayed as pointer gap; User can adjust Y-axis Gridline gap value (0 to hide);

among012a - May 05, 2022 @ 11:56

This is a really good article. I recently came upon your blog and wanted to express how much I have liked reading your writings. After all, I'll be subscribing to your feed and hoping to hear from you soon!

among us

firemyst - May 07, 2022 @ 13:37

THis indicator doesn't seem to work. I've had to comment out this line:

 

private void Chart_ScrollChanged(ChartScrollEventArgs obj)
        {
            //Chart.SetYRange(MVRange, PVRange);
        }

Because cTrader keeps flashing lines up and down -- the ScrollChanged event is constantly called even though I don't touch it.

Labels are never shown as a result.

TheNiatpac - May 07, 2022 @ 13:49

firemyst 

It's working perfectly here. I only use it in TimeFrame 1minute(intraday) and 4minute(weekly long)

You can set Y-range auto-scaled by put 0/0, to viewable range +-.

 

TheNiatpac - May 07, 2022 @ 13:52

firemyst 

Labels are shown at the end of the indicator, it's working normally also, just tick all 'Yes' on the setting page under the Label group.

firemyst - May 07, 2022 @ 13:56

Still doesn't work. I can't post a screen capture or video here. It might be working for you, but it's definitely not on Pepperstone cTrader here.

My email: "stackover41" @ "mail.com".

Send me a message please (hopefully with a screen capture of your suggested configs) and I can respond back with a video and screen captures showing you the issues.

firemyst - May 07, 2022 @ 13:57

should have been "stackoverflow41" and not "stackover41"

TheNiatpac - May 07, 2022 @ 13:59

You can join my Telegram Group for easy discussion there.

https://t.me/cTraderFXClub

TheNiatpac - May 11, 2022 @ 23:50

  • v2.01 Alt+MouseLeftClick in the chart, to turn off/on AutoSet Y-Axis viewable range; Optimise displaying of labels; Fixed bug of total spread;

TheNiatpac - May 16, 2022 @ 19:41

  • v2.02 Optimise: Indicators calculation, Displaying of Label and Code Structure;
5