ExponentialMovingAverage

Created at 08 Jun 2023, 02:15
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!
JA

jalmir.coelho@gmail.com

Joined 19.07.2017

ExponentialMovingAverage
08 Jun 2023, 02:15


To load an Exponential average I use:
Result = Indicators.Exponential Moving Average(Source, 8);
How to load an Exponential Average with SHIFT according to the following image?

 


@jalmir.coelho@gmail.com
Replies

firemyst
08 Jun 2023, 03:21 ( Updated at: 21 Dec 2023, 09:23 )

RE:

jalmir.coelho@gmail.com said:

 

To load a Exponencial Average mean i use: 

Result = Indicators.ExponentialMovingAverage(Source, 8);

How make to load a Exponencial Average with STANDART DESVIATION according to next image?

 

First, the "Shift" parameter has nothing to do with Standard deviation. The Shift parameter moves the results of the EMA either forward or backwards along the X-axis on the chart.

If you want a standard deviation, use either the standard deviation indicator, or the Bollinger Bands indicator. Both are located under the "Volatility" indicator submenu.

 


@firemyst

jalmir.coelho@gmail.com
08 Jun 2023, 18:01 ( Updated at: 21 Dec 2023, 09:23 )

RE: RE: I understand, I expressed myself wrong, what I really need is to capture the average value with a displacement of 1. How can I do this?

firemyst said:

jalmir.coelho@gmail.com said:

 

To load a Exponencial Average mean i use: 

Result = Indicators.ExponentialMovingAverage(Source, 8);

How make to load a Exponencial Average with STANDART DESVIATION according to next image?

 

First, the "Shift" parameter has nothing to do with Standard deviation. The Shift parameter moves the results of the EMA either forward or backwards along the X-axis on the chart.

If you want a standard deviation, use either the standard deviation indicator, or the Bollinger Bands indicator. Both are located under the "Volatility" indicator submenu.

 

 


@jalmir.coelho@gmail.com

firemyst
09 Jun 2023, 02:56 ( Updated at: 21 Dec 2023, 09:23 )

RE:

jalmir.coelho@gmail.com said:

To load an Exponential average I use:
Result = Indicators.Exponential Moving Average(Source, 8);
How to load an Exponential Average with SHIFT according to the following image?

 

You can't do it directly with the API, which is a FAIL on Spotware's part (and whoever's in charge of the API team should be slapped for this). When needing the SHIFT parameter, Spotware's API includes it with other indicator api's like the Alligator, but not on the MA constructors where it's listed as a parameter. Who made this idiotic decision?

 

Anyway, the point being you have to do it yourself:
 

//Example to help you get started

[Parameter("Shift", DefaultValue = 0, MinValue = -100, MaxValue = 500)]
public int MAShift { get; set; }


public override void Calculate(int index)
{
    //Do your own SHIFTing
    int currentIndex = index + MAShift;

    //Now get the shifted results from the moving average
    Result[currentIndex] = _expMovingAverage.Result[index];

    //the rest of your code
}

 


@firemyst