Moving Average for Specified Pair

Created at 01 Apr 2015, 22:18
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!
deklin's avatar

deklin

Joined 31.12.2014

Moving Average for Specified Pair
01 Apr 2015, 22:18


This cBot code returns moving moving average information based on the chart the bot is attached to.  How can I get it to return moving average information for the pair "USDCHF" regardless of what chart the bot is attached to?

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

namespace cAlgo
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class SampleTrendcBot : Robot
    {
        protected override void OnTick()
        {
            MovingAverage ma = Indicators.MovingAverage(MarketSeries.Close, 8, MovingAverageType.WilderSmoothing);
            Print(ma.Result.Last(0));
        }
    }
}

 


@deklin
Replies

Spotware
06 Apr 2015, 12:38

Please see /forum/cbot-support/4746


@Spotware