PDA

View Full Version : Overflow exception Runtime '6',



newtonmark
04-24-2012, 06:30 PM
Hello, when i use the Currency server API, i got this exception after i user the example client to connect my own application implemnet server API. Can you give me some advice on the exception?Overflow exception Runtime '6',

newtonmark
04-24-2012, 06:31 PM
Hello, when i use the Currency server API, i got this exception after i user the example client to connect my own application implemnet server API. Can you give me some advice on the exception?Overflow exception Runtime '6',

Yousef-HS
04-25-2012, 08:40 AM
Hello newtonmark,

This is a problem with the data supplied through the interface. The error may show up if you would have sent a double value to an integer variable which it seems that it was not handled in your application. So, first check your data, change it and try once again and see it.

Also, this error may occur when the value returned from some part of your application is too large for the default type that will contain the value.

AlgoNaute
04-26-2012, 07:27 PM
Hi Yousef,

I am following the topics because newtonmark who works with me has been banned (an error I guess) and he can not reply... So here is its answer.

Hello

I use the following function to broadcasting the prices


string symbolid = m_instruments.Symbol();

double ask = double.Parse(AskPrices.Price.ToString());

double bid = double.Parse(BidPrices.Price.ToString());
double high = double.Parse(DailyHighestTradedPrice.ToString());
double low = double.Parse(DailyLowestTradedPrice.ToString());

string bank = "bank";
int volume = 0;
vertexServer.AddPriceBuffer(ref symbolid, ref ask, ref bid, ref high, ref low, bank, volume);
According to your CurrencyServer API, we need to invoke this method to add the price to buffer before broadcast it.

"vertexServer.AddPriceBuffer(ref symbolid, ref ask, ref bid, ref high, ref low, bank, volume);"[PHP]

They only accept symbolid as string, ask, bid, high, low as double, bank as string and volume as int. I do not know how it is possible for me to pass a double value to an integer. I also do not know what do you mean by the data is large? Thank you.

Yousef-HS
04-30-2012, 07:50 AM
Hello,

We have resolved the case of banning the other user as because the automation anti-spam protection module banned the user because of a mistaken rule and now everything is fine.

For the large amount, and integer can only hold numbers between -32768 and +32767. If the value is larger than that, it may cause an Overflow exception. Make sure of the value by debugging the project and by going through the broadcasting procedure to find out the value.