Topics

Forum Topics not found

Replies

Hlautameki
28 Oct 2024, 21:06 ( Updated at: 29 Oct 2024, 06:25 )

RE: RE: RE: RE: RE: Mac version doesn't have the Deal Map viewing option

levd20 said: 

levd20 said: 

This is what i built right now (CODE3 in ATTACHEMENT)
Please tell me:

  1. Wheather it works in your workarount
  2. if it is written and commented correctly (fits all formatting standards)
  3. if you have further ideas to make it shorter
  4. if you have further ideas to expand it with more functions

Feel free to use it for whatever you like.

Best regards
levd20 

 

______________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
ATTACHEMENT
CODE3:

using cAlgo.API;using cAlgo.API.Indicators;using cAlgo.API.Internals;namespace cAlgo.Indicators{    [Indicator(IsOverlay = true, AccessRights = AccessRights.None)]    public class paddysDealMap : Indicator    {        #region Parameter        [Parameter("Show Vertical Lines", Group = "Visibility", DefaultValue = true)]        public bool showVerticalLines { get; set; }        [Parameter("Show Trade Lines", Group = "Visibility", DefaultValue = true)]        public bool showTradeLines { get; set; }        [Parameter("Show Deal Stats", Group = "Visibility", DefaultValue = true)]        public bool showDealStats { get; set; }        #endregion        protected override void Initialize()        {               Chart.RemoveAllObjects();            DrawVerticalLines();            DrawDealMap();            DrawDealStats();        }        #region own Methods        private void DrawVerticalLines()        {            foreach (var Trade in History)            {                   if(showVerticalLines && Trade.TradeType == TradeType.Buy)   // green Line, when it's a Long-Order                {                    Chart.DrawVerticalLine(                        "Open_" + Trade.PositionId,                         Trade.EntryTime,                         Color.Green                    );                }                if(showVerticalLines && Trade.TradeType == TradeType.Sell)  // red Line, when it's a Short-Order                {                    Chart.DrawVerticalLine(                        "Open_" + Trade.PositionId,                         Trade.EntryTime,                         Color.Red                    );                }            }        }        private void DrawDealMap()        {             foreach (var Trade in History)            {                 if(showTradeLines && Trade.NetProfit>0)                     // When Trade was profitable -> green dealMapLine                    {                        var TrendLine = Chart.DrawTrendLine(                            "TradelLine " + Trade.PositionId,               // unique Name of the TrendLine                            Trade.EntryTime,                                // X1 OpenTime                            Trade.EntryPrice,                               // Y1 OpenPrice                            Trade.ClosingTime,                              // X2 ClosingTime                            Trade.ClosingPrice,                             // Y2 ClosingPrice                            Color.LightGreen,                               // Color                            3,                                              // Line Thickness                            LineStyle.Solid                                 // Line Style                        );                                                   }                    if(showTradeLines && Trade.NetProfit<0)                 // When Trade was profitable -> green dealMapLine                    {                        var TrendLine = Chart.DrawTrendLine(                            "TradelLine " + Trade.PositionId,               // unique Name of the TrendLine                            Trade.EntryTime,                                // X1 OpenTime                            Trade.EntryPrice,                               // Y1 OpenPrice                            Trade.ClosingTime,                              // X2 ClosingTime                            Trade.ClosingPrice,                             // Y2 ClosingPrice                            Color.Magenta,                                  // Color                            3,                                              // Line Thickness                            LineStyle.Solid                                 // Line Style                        );                       }            }        }        private void DrawDealStats()        {             foreach (var Trade in History)            {                 string sign = Trade.NetProfit > 0 ? "+" : "";                string dealStats = $"{sign}{Trade.NetProfit / Account.Balance:0.00%}\n"+Trade.NetProfit.ToString("F2")+" €";                                if(showDealStats && Trade.NetProfit > 0)                {                     Chart.DrawText(                        "DealNetProfit" + Trade.PositionId,                        dealStats,                        Trade.ClosingTime,                        Trade.ClosingPrice,                        Color.LightGreen                    );                }                if(showDealStats && Trade.NetProfit < 0)                {                     Chart.DrawText(                        "DealNetProfit" + Trade.PositionId,                        dealStats,                        Trade.ClosingTime,                        Trade.ClosingPrice,                        Color.Magenta                    );                }            }        }        #endregion own Methods        public override void Calculate(int index) { }                }}

PanagiotisCharalampous said: 

cBotTrader said: 

PanagiotisCharalampous said: 

Hi there,

It will be added in a future update.

Best regards,

Panagiotis

Hi!

i saw many improvemnts on mac version. It seemn now backtesting work. But the Deal Map still missing. this feature is very peaciuos when analysing things. 

we still wating for this! 
 

thanks!

Hi there,

Deal map has not been released yet for cTrader Mac.

Best regards,

Panagiotis

Anyone knows when dealMap for mac will be released?

 

Great job. Thank you levd20 for sharing. It's very helpful while dealMap is not available on Mac.


@Hlautameki