Referencing a different chart CBot?

Created at 23 Oct 2024, 17:09
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!
GI

Giorgi_1

Joined 23.06.2023

Referencing a different chart CBot?
23 Oct 2024, 17:09


Hi guys, 

Do you know if it's possible to reference another chart's cBot?

Scenario:

I have two charts, both have the same cBot running. The cBot contains Togglebuttons that are either set to on/off. 

Is it possible to code an interaction between Chart 1 and Chart 2 whereby if i change the Togglebutton on Chart1, that change is replicated to Chart2?

Or is this possible via a plugin? I'd like to create an on off button that affects all open charts.  Or is it possible to reference a plugin object state from within a cBot?

Many Thanks, 


@Giorgi_1
Replies

firemyst
24 Oct 2024, 00:54

I'm not sure about a plugin situation, but you can save the toggle button states to a file, and when the file is updated have your other running cBots read/update their charts based on whatever values you have saved in the file.

 

Note that this method isn't possible if you're running bots in the cloud as I don't believe bots in the cloud can read/write files.

 

Keep us posted with the solution you implement.


@firemyst

Giorgi_1
24 Oct 2024, 04:16

RE: Referencing a different chart CBot?

firemyst said: 

I'm not sure about a plugin situation, but you can save the toggle button states to a file, and when the file is updated have your other running cBots read/update their charts based on whatever values you have saved in the file.

 

Note that this method isn't possible if you're running bots in the cloud as I don't believe bots in the cloud can read/write files.

 

Keep us posted with the solution you implement.

Thanks firemyst, i did think of the external file solution, but thought there may be a more “built-in” solution. Something similar to the Sync Chart Objects Indicator that allows a change on one, to affect all. I'll keep looking and will update with any solution i find. If anyone does know if you're able to reference plug-ins from within a cBot, i'd be very interested as to how to implement it. 

Many Thanks, 


@Giorgi_1

PanagiotisCharalampous
24 Oct 2024, 05:59

RE: RE: Referencing a different chart CBot?

Giorgi_1 said: 

firemyst said: 

I'm not sure about a plugin situation, but you can save the toggle button states to a file, and when the file is updated have your other running cBots read/update their charts based on whatever values you have saved in the file.

 

Note that this method isn't possible if you're running bots in the cloud as I don't believe bots in the cloud can read/write files.

 

Keep us posted with the solution you implement.

Thanks firemyst, i did think of the external file solution, but thought there may be a more “built-in” solution. Something similar to the Sync Chart Objects Indicator that allows a change on one, to affect all. I'll keep looking and will update with any solution i find. If anyone does know if you're able to reference plug-ins from within a cBot, i'd be very interested as to how to implement it. 

Many Thanks, 

Hi there,

Have a look at this video. It will give you some ideas


@PanagiotisCharalampous