ChartArea Interface - drawfibonacciretracement - Not Available - SPOTWARE PLEASE ADVISE

Created at 23 Aug 2018, 11:39
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!
MY

myinvestmentsfx

Joined 06.11.2017

ChartArea Interface - drawfibonacciretracement - Not Available - SPOTWARE PLEASE ADVISE
23 Aug 2018, 11:39


Hi Spotware,

Please can you share how to use the ChartArea Interface?  Is it still available to use?

https://ctrader.com/api/reference/chartarea/drawfibonacciretracement

If you could use the drawfibonacciretracement method as an example that would be great.

 


@myinvestmentsfx
Replies

PanagiotisCharalampous
23 Aug 2018, 11:48

Hi myinvestmentsfx,

See below an example

Chart.DrawFibonacciRetracement("Example", Server.Time, 1.14, Server.Time.AddDays(-1), 1.16, Color.Red);

Best Regards,

Panagiotis


@PanagiotisCharalampous

myinvestmentsfx
23 Aug 2018, 12:05 ( Updated at: 21 Dec 2023, 09:20 )

RE:

Panagiotis Charalampous said:

Hi myinvestmentsfx,

See below an example

Chart.DrawFibonacciRetracement("Example", Server.Time, 1.14, Server.Time.AddDays(-1), 1.16, Color.Red);

Best Regards,

Panagiotis

Hi Panagiotis,

The method doesn't seem to exist under Chart?


@myinvestmentsfx

PanagiotisCharalampous
23 Aug 2018, 12:08

Hi myinvestmentsfx,

The method is only available in cTrader Automate 3.01 which is currently in Beta. It will be rolled out to brokers in the near future.

Best Regards,

Panagiotis


@PanagiotisCharalampous

myinvestmentsfx
23 Aug 2018, 18:38

Thank you Panagiotis,  appriciate the help. I've download the platform directly from Spotware and have all the methods now.

How would you access the FibonacciLevel Values of the one you just drawed?

            var drawFibo = Chart.DrawFibonacciRetracement("test", startIndex, startValue, stopIndex, stopValue, "Black", 1, LineStyle.LinesDots);
            var myDictionary = drawFibo.FibonacciLevels.ToDictionary(????)

Kind Regards,


@myinvestmentsfx

myinvestmentsfx
24 Aug 2018, 08:56

RE:

myinvestmentsfx said:

Thank you Panagiotis,  appriciate the help. I've download the platform directly from Spotware and have all the methods now.

How would you access the FibonacciLevel Values of the one you just drawed?

            var drawFibo = Chart.DrawFibonacciRetracement("test", startIndex, startValue, stopIndex, stopValue, "Black", 1, LineStyle.LinesDots);
            var myDictionary = drawFibo.FibonacciLevels.ToDictionary(????)

Kind Regards,

Just to be clear, i'm look for the prices that corresponds with the fibonannci % level. 

I know it's possible to {get; set:) percentage level as per below.  But how do I get the corresponding price that maps to the percetage level?  I'm assuming this should be available since the calculation is done in the background to display it on the chart. 

            var drawFibo = Chart.DrawFibonacciRetracement("test", startIndex, startValue, stopIndex, stopValue, "Black", 1, LineStyle.LinesDots);
            var x = drawFibo.FibonacciLevels[0];
            var y = x.PercentLevel = 20;
            var z = drawFibo.DisplayPrices = true;


@myinvestmentsfx

PanagiotisCharalampous
24 Aug 2018, 11:44

Ηι myinvestmentsfx,

The price is not directly accessible via the API but you can use the following function to calculate it.

private double GetFibonacciLevelPrice(ChartFibonacciRetracement fibo, double percentLevel)
{
    return (fibo.Y2 - fibo.Y1) * (1 - percentLevel / 100) + fibo.Y1;
}

Best Regards,

Panagiotis


@PanagiotisCharalampous