Replies

arturbrylka
28 Apr 2021, 10:22

RE:

amusleh said:

Hi,

The message tells you that the exception was thrown inside OnBar method, what you can do is put all your OnBar method code inside a try/catch block and check the thrown exception data or print its stacktrace, do this only for debugging and remove it when you find and fixed the issue because using general try/catch block for Exception type is not a good coding practice.

Hi Amusleh,

thank you for your comment. Just to avoid misunderstandings let me rephrase and underline the central point of my question:

Is there a possibility to print the stacktrace using the VS debug mode?

Kind regards

Artur


@arturbrylka

arturbrylka
16 Mar 2021, 10:54

RE:

PanagiotisCharalampous said:

Dear arturbrylka,

Can you explain in more detail what do you mean when you say 

been pushed automatically through the indicator.

Where is the indicator declared? Can you provide the code? How do you check if the bars are "pushed"?

Best Regards,

Panagiotis 

Join us on Telegram

1) The indicator is declared in the bot:

private MyIndicator myi;

        protected override void OnStart()
        {
           ...
            myi = Indicators.GetIndicator<MyIndicator>();
        }

2) I see that the bars are not pushed through the indicator as I am logging to console from the OnBarClosed within the indicator:

 

public void OnBarClosed(int index)
        {
            Print("tick: " + series1.OpenTime[index]);

.....

Please remember: During backtesting every works completely fine, so I have no doubts about the general functioning of the code.


@arturbrylka

arturbrylka
16 Mar 2021, 10:17 ( Updated at: 16 Mar 2021, 10:18 )

RE:

PanagiotisCharalampous said:

Dear arturbrylka,

You can use LoadMoreHistory method to achieve this.

Best Regards,

Panagiotis 

Join us on Telegram

 

Hi Panagiotis,

that's what I already did, as You described in another thread. I put it in the bot, which loaded then more ticks but the bars have not been pushed automatically through the indicator.

protected override void OnStart()
        {
            Print("{0} bar on the chart. Loading 10 000 bars", Bars.Count);
            while (Bars.Count < 10000)
            {
                var loadedCount = Bars.LoadMoreHistory();
                Print("Loaded {0} bars", loadedCount);
                if (loadedCount == 0)
                    break;
            }
            Print("Finished, total bars {0}", Bars.Count);

....

}


@arturbrylka

arturbrylka
13 May 2020, 00:54

Problem has been solved with another proxy.


@arturbrylka