Mac version doesn't have the Deal Map viewing option

Created at 10 Feb 2024, 07:21
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
DO

dothebloodydishes

Joined 10.02.2024

Mac version doesn't have the Deal Map viewing option
10 Feb 2024, 07:21


Any plans?

Thank you

/


@dothebloodydishes
Replies

PanagiotisCharalampous
10 Feb 2024, 08:25

Hi there,

It will be added in a future update.

Best regards,

Panagiotis


@PanagiotisCharalampous

dothebloodydishes
10 Feb 2024, 18:39 ( Updated at: 11 Feb 2024, 07:05 )

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

PanagiotisCharalampous said: 

Hi there,

It will be added in a future update.

Best regards,

Panagiotis

looking forward to it, thank you for a mac version


@dothebloodydishes

BadummTish
19 Mar 2024, 15:10 ( Updated at: 20 Mar 2024, 06:56 )

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

PanagiotisCharalampous said: 

Hi there,

It will be added in a future update.

Best regards,

Panagiotis

Thanks. Glad to see that the mac desktop version will be getting regular updates. Have seen some already with v4.8.904 which improved usability for open trades on the chart. 👍


@BadummTish

cBotTrader
31 Jul 2024, 12:24

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

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!


@cBotTrader

PanagiotisCharalampous
01 Aug 2024, 06:28

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

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


@PanagiotisCharalampous

levd20
25 Aug 2024, 11:01 ( Updated at: 26 Aug 2024, 06:44 )

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

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?


@levd20

levd20
01 Sep 2024, 10:39 ( Updated at: 02 Sep 2024, 05:28 )

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

levd20 said: 

Hi, i am new to cTrader & c#. But thanks to PanagiotisCharalampous frequently helping and constructive answers in nearly every thread and some other research i was able to build a dealMap kinda myself as an indicator.

Little Story of how i got there:
At first i catched the Events via OnPositionClosed(PositionClosedEventArgs args), and added this into a Robot. 
Unfortunately the backtests taking HUGE time (15 simulations over night with the weakest MacBookAir A1932)
So i removed the drawing-Lines from my sample-Code (standard MACDCrossOver) and ran the backtest “lean” and without any disturbing lines of code.
Result: 1300 simulations in 1h 40mins → Lesson learnt!

So i had to code the dealMap into an indicator, to run the Indicator seperately after the Optimization/Parameter Sweep. Whysoever the Events (OnPositionClosed,…) are not being triggered (see code down below, CODE2), but i was able to just draw all Lines from the history. (see below, CODE1)
This is only lean code to draw a verticalLine everytime a trade has been opened. Now it should be easy to change the code to the wanted dealMap-feature (line between open and close).

I have two further questions:
- Is sweeping the history really the most elegant way? (CODE1)
- e.g. i run a single backtest with CODE1. How is the backtesting calculation being prioritized? is the robot running through at first and than coming the indicator, or are Robot & Indicator being calculated parallely? Do i have to add the indicator to the backtest window before i run the backtest, or does it not matter when i add the indicator? → if it doesn't matter when i add it → Why? How is it being prioritized?

 

Greetings from Germany!
levd20

______________________________________________________________________________________________________________________________________

ATTACHEMENT

CODE 1:

using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;

namespace cAlgo.Indicators
{
    [Indicator(IsOverlay = true, AccessRights = AccessRights.None)]
    public class SimpleTradeLinesFromHistory : Indicator
    {
    	// you will FIRST have to run the Backtest and THEN add this indicator! -> only being executed while Initialize()! -> instantly after adding the Indicator to the chart. -> every new Backtest = delete and add the indicator to the chart again. I'm working on fixing this.
        protected override void Initialize()
        {
            DrawTradeLines();
        }

        private void DrawTradeLines()
        {
            foreach (var position in History)
            {
                    Chart.DrawVerticalLine("Open_" + position.PositionId, position.EntryTime, Color.Blue);
            }
        }

        public override void Calculate(int index) { }
    }
}

 

Are there some other possibilities to create dealMaps without using the history? 
OnPositionsOpened did not trigger → no Print in the Log :(
CODE 2:

using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;

namespace cAlgo.Indicators
{
    [Indicator(IsOverlay = true, AccessRights = AccessRights.None)]
    public class SimpleTradeLines : Indicator
    {
        protected override void Initialize()
        {
            Positions.Opened += OnPositionsOpened;
            Positions.Closed += OnPositionsClosed;
        }

        private void OnPositionsOpened(PositionOpenedEventArgs args)
        {
            Chart.DrawVerticalLine("Open_" + args.Position.Id, args.Position.EntryTime, Color.Blue);
            Print("POSITION OPENED!");
            Print("----------------");
        }

        private void OnPositionsClosed(PositionClosedEventArgs args)
        {
            Chart.DrawVerticalLine("Close_" + args.Position.Id, args.Position.ExitTime, Color.Red);
            Print("POSITION CLOSED!");
            Print("----------------");
        }

        public override void Calculate(int index) { }
    }
}

 

Another good inspiration was this one: https://ctrader.com/algos/indicators/show/3026/
But it didn't show all past trades on my Backtest, so we will have to put some work in it.

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?

 


@levd20

levd20
01 Sep 2024, 15:13 ( Updated at: 02 Sep 2024, 05:28 )

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

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?

 


@levd20

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