Replies

bernhardCM
18 Jul 2024, 07:40

sorry ...

reply button gave me no response that message was sent, please ignore double posts :-(


@bernhardCM

bernhardCM
18 Jul 2024, 07:38

RE: "maintenance mode / server down" several hours during trading session

Hi Panagotis,

thanks for your reply! Information about further processing after re-connection seems to be clear.

How about?

  • Will the StopLoss (or Trailing StopLoss) be triggered when price will go below(long)/above(short), if the cTrader server is down? So will the StopLoss also handed over to the broker so that the broker will close the position?
  • Is there any way to check in cBot automatically the connection of the server whether live, down, maintenance? To get notified after re-connection would be also great.

With these information I would be fully satisfied :-)

Thank you so much!

Best regards,

Bernhard


@bernhardCM

bernhardCM
18 Jul 2024, 07:38

RE: "maintenance mode / server down" several hours during trading session

Hi Panagotis,

thanks for your reply! Information about further processing after re-connection seems to be clear.

How about?

  • Will the StopLoss (or Trailing StopLoss) be triggered when price will go below(long)/above(short), if the cTrader server is down? So will the StopLoss also handed over to the broker so that the broker will close the position?
  • Is there any way to check in cBot automatically the connection of the server whether live, down, maintenance? To get notified after re-connection would be also great.

With these information I would be fully satisfied :-)

Thank you so much!

Best regards,

Bernhard


@bernhardCM

bernhardCM
18 Jul 2024, 07:38

RE: "maintenance mode / server down" several hours during trading session

Hi Panagotis,

thanks for your reply! Information about further processing after re-connection seems to be clear.

How about?

  • Will the StopLoss (or Trailing StopLoss) be triggered when price will go below(long)/above(short), if the cTrader server is down? So will the StopLoss also handed over to the broker so that the broker will close the position?
  • Is there any way to check in cBot automatically the connection of the server whether live, down, maintenance? To get notified after re-connection would be also great.

With these information I would be fully satisfied :-)

Thank you so much!

Best regards,

Bernhard


@bernhardCM

bernhardCM
18 Jul 2024, 07:38

RE: "maintenance mode / server down" several hours during trading session

Hi Panagotis,

thanks for your reply! Information about further processing after re-connection seems to be clear.

How about?

  • Will the StopLoss (or Trailing StopLoss) be triggered when price will go below(long)/above(short), if the cTrader server is down? So will the StopLoss also handed over to the broker so that the broker will close the position?
  • Is there any way to check in cBot automatically the connection of the server whether live, down, maintenance? To get notified after re-connection would be also great.

With these information I would be fully satisfied :-)

Thank you so much!

Best regards,

Bernhard


@bernhardCM

bernhardCM
18 Jul 2024, 07:38

RE: "maintenance mode / server down" several hours during trading session

Hi Panagotis,

thanks for your reply! Information about further processing after re-connection seems to be clear.

How about?

  • Will the StopLoss (or Trailing StopLoss) be triggered when price will go below(long)/above(short), if the cTrader server is down? So will the StopLoss also handed over to the broker so that the broker will close the position?
  • Is there any way to check in cBot automatically the connection of the server whether live, down, maintenance? To get notified after re-connection would be also great.

With these information I would be fully satisfied :-)

Thank you so much!

Best regards,

Bernhard


@bernhardCM

bernhardCM
18 Jul 2024, 07:38

RE: "maintenance mode / server down" several hours during trading session

Hi Panagotis,

thanks for your reply! Information about further processing after re-connection seems to be clear.

How about?

  • Will the StopLoss (or Trailing StopLoss) be triggered when price will go below(long)/above(short), if the cTrader server is down? So will the StopLoss also handed over to the broker so that the broker will close the position?
  • Is there any way to check in cBot automatically the connection of the server whether live, down, maintenance? To get notified after re-connection would be also great.

With these information I would be fully satisfied :-)

Thank you so much!

Best regards,

Bernhard


@bernhardCM

bernhardCM
18 Jul 2024, 07:38

RE: "maintenance mode / server down" several hours during trading session

PanagiotisCharalampous said: 

Hi Bernhard

  • cBots: once the connection was re-established, will the OnStart()-Method called again?

No

  • cBots: once the connection was re-established, will the OnTick()-Method called for each single tick of the disconnection gap which is probably now delivered?

No, the cBot resumes from the new streamed tick

  • cBots: once the connection was re-established, will the OnBar()-Method called for each single bar of the disconnection gap which is probably now delivered?

No, the cBot resumes from the new streamed bar

  • Indicators: Is there something special indicator methods (initialize?!, calculate?!) considered once the connection was re-established?

On reconnection the indicator is reinitialized.

Best regards,

Panagiotis

Hi Panagotis,

thanks for your reply! Information about further processing after re-connection seems to be clear.

How about?

  • Will the StopLoss (or Trailing StopLoss) be triggered when price will go below(long)/above(short), if the cTrader server is down? So will the StopLoss also handed over to the broker so that the broker will close the position?
  • Is there any way to check in cBot automatically the connection of the server whether live, down, maintenance? To get notified after re-connection would be also great.

With these information I would be fully satisfied :-)

Thank you so much!

Best regards,

Bernhard


@bernhardCM

bernhardCM
21 Jun 2024, 10:50

RE: RE: Custom indicator in cBot different results visual mode compared to silent mode

No that is not what I said. Indicators referenced in a strategy will use the source set in the backtesting settings. Indicators applied on the chart will be rendered at the moment they are applied, so all past bars will be considered historical

first of all, Panagiotis thanks for your great replies to actually all threads I found in this forum already, as well to this one.

Just to make it sure in my own (not native English speaking … poorer) words ;-)

  1. with “strategy” I guess you mean a cBot.
  2. backtesting settings & optimization settings (e.g. ticks instead of chart timeframe data) will be correct processed, in the backend of backtesting & optimization
  3. point 2. is also applicable for indicators on the chart shown on backtesting in visual mode
  4. all other indicators (chart in trade section or chart in backtesting in NON visual mode) will show historically only chart timeframe data, for “IsLastBar” it will be also consider ticks

That's what I extracted as summary and it's no open question, except I wrote something wrong.

Thanks for all and have a nice weekend!


@bernhardCM

bernhardCM
21 Jun 2024, 06:48 ( Updated at: 21 Jun 2024, 06:49 )

thanks for your prompt reply.

hmmm, so for backtesting in non visual mode, the setting “tick-data” (instead of m1 data) will not be used, that was not clear to me and looks frankly spoken … wrong ;-) 

but now I know how it works. Thank you for clarification!

By the way, how about Optimization, there we can also select "tick-data accurate”. Are the indicators there also only calculated once per bar? Because there is no visual mode available.

Thank you.

 


@bernhardCM

bernhardCM
14 May 2024, 09:02

RE: RE: RE: referencing an custom Indicator

great, thanks for your prompt answer!


@bernhardCM

bernhardCM
13 May 2024, 22:23 ( Updated at: 14 May 2024, 05:22 )

RE: referencing an custom Indicator

PanagiotisCharalampous said: 

Hi xabbu,

You are passing wrong parameters in the indicator. Here is the correct way to initialize it

 _sma = Indicators.GetIndicator<SampleSMA>(MarketData.GetBars(TimeFrame.Daily).ClosePrices, 14);

Best Regards,

Panagiotis 

Join us on Telegram

 

Hi Panagiotis,

is there a particular indicator calculation order or could we influence it, e.g. by priorities?

In the example mentioned above the custom indicator “NNFXInfosonChart” uses the values of custom indicator “SampleSMA”, but how we can make sure that SampleSMA.LastValue is belonging to current Index (Index of NNFXInfosonChart.Calculation(THIS_INDEX)) and not to the previous index when retrieved in NNFXInfosonChart.Calculation-method?

Thank you so much.

Best regards,

Bernhard


@bernhardCM

bernhardCM
09 Nov 2023, 08:32 ( Updated at: 09 Nov 2023, 10:44 )

Hello,

the search function is a bit difficult in this forum :-) sorting by last activity instead of search by “heartbeat” I found that thread: https://ctrader.com/forum/connect-api-support/38894 about the same issue, which states: 

  • I need to send heartbeats each 10 seconds, otherwise connection will be closed after some seconds, but I will not get any notification whether my sent heartbeat has been accepted, or there was maybe any difficulty
  • just need to listen to the OnProtoHeartbeatEvent and whether there arrives a call each 30 seconds as notification that connection is still open - which has nothing to do with my sent heartbeat itself

Is that the correct solution and made I correct by my code above?

Thank you.

Bernhard


@bernhardCM