Difference between cbot indicator output and graph indicator value

Created at 17 Jun 2015, 09:43
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!
10

1015300

Joined 26.03.2015

Difference between cbot indicator output and graph indicator value
17 Jun 2015, 09:43


namespace cAlgo
{
    [Robot(TimeZone = TimeZones.ChinaStandardTime, AccessRights = AccessRights.Internet | AccessRights.Registry | AccessRights.FileSystem | AccessRights.FullAccess)]
    public class TestCbot : Robot
    {

        [Parameter("Another Timeframe2", DefaultValue = "Minute")]
        public TimeFrame AnotherTimeFrame2 { get; set; }

 
        private KFDiff_AMA_Diff cbotKFDiff_SMA_Diff_Sub2;



        protected override void OnStart()
        {

        
            Sub2TimeFrame = MarketData.GetSeries(AnotherTimeFrame2);
            cbotKFDiff_SMA_Diff_Sub2 = Indicators.GetIndicator(Sub2TimeFrame.Close, Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9,
            Param10, Param11, Param12);
 
        }

        protected override void OnTick()
        {
            // Put your core logic here
                      
                        douSub2PLastTemp = cbotKFDiff_SMA_Diff_Sub2.KFDiff_SMA_Diff_Out.LastValue;

                        Print("0 douSub2PLastTemp {0}", douSub2PLastTemp);

    
        }
}

Hi, I am a newbie in composing cBots.

I write my own custom indicator and being called in the cBot. I then use in cTrader's platform and activate my cBot. But I find that the indicator value shown in the graph is difference from my output of indicator value from my code (graph: -0.27, cbot log output: -0.5193). I have enclosed part of my code and the screen capture​. Have I made any mistake when calling the indicator? Thanks a lot.

 

 


@1015300
Replies

Spotware
17 Jun 2015, 12:56

Dear Trader,

We do not provide coding assistance services. We more than glad to assist you with specific questions about cAlgo.API. You also can contact one of our Partners or post a job in Development Jobs section for further coding assistance.

 


@Spotware

botmaster
19 Jun 2015, 19:58

I'd like to know when the documentation will be updated to explain why graph (indicator) values and log values are different.  At least provide adequate documentation that explains how MarketData is created/returned for each event OnBar(), OnTick(), etc .    There are many unanswered threads on this forum that are asking this very question.


@botmaster

Spotware
22 Jun 2015, 16:46

Dear Trader,

Please check the following link: /api/reference/internals/marketdata

It provides you information regarding the MarketData. For your information it is in our plans to update the API documentation in the future. Stay tuned.


@Spotware

WhiteSage
25 Jun 2015, 16:26

Robots and Charts have a different level of history, when its in a chart you may have 8000~ bars of history, when its in a backtest/optimize you may only get a few hundred samples. I'm unsure if its the case here but it's worth checking. Have your code Print(MarketSeries.Open.Count) to find out. Best of luck.


@WhiteSage