live indicators values

Created at 09 Oct 2020, 14:45
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!
star_indark's avatar

star_indark

Joined 09.10.2020

live indicators values
09 Oct 2020, 14:45


Hello :)

I want to create a new indicator.

Therefore, I need live MACD and RSI values ..

Can you provide me with codes from which I can derive the live indicators values ..

You also provide live prices at this link .. as I want it that way

http://spotware.ctrader.com/mw/?frame=3b3b3b&frametext=ffffff&background=292929&grid=3B3B3B&symbolname=ffffff&spread=ffffff&pricerising=009345&pricefalling=F15A24&staleprice=ffffff&feedlev=ffffff&feedam=6A8080&hl=ffffff&scroll=808080&button=009345&buttontext=ffffff&btbidask=ffffff&w=400&h=400&fullwidth=0&fbshow=0&fbt=&type=all

 

 

 

Best regards


@star_indark
Replies

PanagiotisCharalampous
09 Oct 2020, 15:09

Hi star_indark,

See below an example on how to read MACD and RSI values from a custom indicator

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

namespace cAlgo
{
    [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class NewIndicator : Indicator
    {
        [Parameter(DefaultValue = 0.0)]
        public double Parameter { get; set; }

        [Output("Main")]
        public IndicatorDataSeries Result { get; set; }

        MacdCrossOver _macd;
        RelativeStrengthIndex _rsi;
        protected override void Initialize()
        {
            _macd = Indicators.MacdCrossOver(26, 12, 9);
            _rsi = Indicators.RelativeStrengthIndex(Bars.ClosePrices, 14);
        }

        public override void Calculate(int index)
        {
            Print("MACD: " + _macd.MACD[index]);
            Print("RSI: " + _rsi.Result[index]);
        }
    }
}

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

star_indark
10 Oct 2020, 15:31

RE: Thank you very much for your response and your time, Mr. Panagiotis

PanagiotisCharalampous said:

Hi star_indark,

See below an example on how to read MACD and RSI values from a custom indicator

.....

Best Regards,

Panagiotis 

Join us on Telegram

 


@star_indark

star_indark
10 Oct 2020, 15:38 ( Updated at: 21 Dec 2023, 09:22 )

Could you give me a complete code please .. :)

 

 

Best Regards

Alhazmi

 


@star_indark

PanagiotisCharalampous
12 Oct 2020, 08:32

Hi star_indark,

If you need somebody to develop something for you, you can always post a Job or hire a Consultant.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous