Multiple Instances of the same cBot on one account crashing OnTick()

Created at 14 Jun 2016, 14:23
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!
evo8fx's avatar

evo8fx

Joined 03.03.2016

Multiple Instances of the same cBot on one account crashing OnTick()
14 Jun 2016, 14:23


Hi All,

I have a cBot I'm working on that runs fine until I start another instance on a different currency pair in the same account.

The position labels are different so I'm not sure what I have overlooked.  If anyone has been through this before I would greatly appreciate your thoughts on this.

Thank you!


@evo8fx
Replies

evo8fx
14 Jun 2016, 14:30

RE:

evo8fx said:

Hi All,

I have a cBot I'm working on that runs fine until I start another instance on a different currency pair in the same account.

The position labels are different so I'm not sure what I have overlooked.  If anyone has been through this before I would greatly appreciate your thoughts on this.

Thank you!

Here is the exact error:

Crashed in OnTick with IndexOutOfRangeExceptioin: Index was outside the bounds of the array.

 


@evo8fx

moneybiz
14 Jun 2016, 15:54

RE:

evo8fx said:

Hi All,

I have a cBot I'm working on that runs fine until I start another instance on a different currency pair in the same account.

The position labels are different so I'm not sure what I have overlooked.  If anyone has been through this before I would greatly appreciate your thoughts on this.

Thank you!

Seems like you're not accessing the related instance's market data correctly. Because index value of the price you want to get is not valid. Maybe you're using more than one symbol data and while the index is valid on one symbol it's not valid index for the other...

Put some code to tell more. :)


@moneybiz

evo8fx
14 Jun 2016, 16:19

RE: RE:

moneybiz said:

evo8fx said:

Hi All,

I have a cBot I'm working on that runs fine until I start another instance on a different currency pair in the same account.

The position labels are different so I'm not sure what I have overlooked.  If anyone has been through this before I would greatly appreciate your thoughts on this.

Thank you!

Seems like you're not accessing the related instance's market data correctly. Because index value of the price you want to get is not valid. Maybe you're using more than one symbol data and while the index is valid on one symbol it's not valid index for the other...

Put some code to tell more. :)

Thanks for the reply moneybiz.

I found it and fixed it.  It is along the lines of what you wrote, but it was previous trade data that I was accessing incorrectly....  Just some sloppy code and I got called out.

 


@evo8fx