PDA

View Full Version : Development of Android and Iphone Trading Application



somilshah
07-10-2014, 07:17 PM
Hello,

We have are developing a Android and Iphone Trading Application for our client. We are have a few doubts to resolve for it.

We have been provided with a few API by them from which they said WCF API has to be used to search web services and connect the platform.

We have been trying to use the WCF API but we are not getting data in reply from the WCF API.

We would like to know how to get the Web Services data in "json" for us to use for developing the Mobile Trading Application.

I have also attached a document for the WEB API where I have specified the command we require. It would be great if you could help us to know how to fetch them using the WCF API provided to us.

Also if you could provide with a guide to help us in the development would be helpful.


I will look forward for a speedy response from you.

Hassan-HS
07-11-2014, 08:22 AM
Hello,


Great, This article (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1925)will assist you in developing your application.

HTML Sample for login:



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>Login</title>

<script src="http://code.jquery.com/jquery-latest.js"></script>

</head>

<script >

$(document).ready(function () {

var urlStr = "http://74.54.46.178/vertexweb10/WebService.svc";

jQuery.support.cors = true;

$("#progress").ajaxStart(function () { $(this).css("display", "block"); });

$("#progress").ajaxComplete(function () { $(this).css("display", "none"); });

function onSuccessResult(response) {

response = eval('(' + response + ')')

if (response.UserId == -1 || response.UserId == -207) {

$("#resultData").html("Invalid username or password");

}

else if (response.UserId == -231) {

$("#resultData").html("You must have at least one account");

}

else if (response == null || response == "" || response.UserId < 0) {

$("#resultData").html("Error while login.Please try later");

}

else {

var resultStr = "SuccessResult ... UserId is :" + response.UserId + "<br/>";

resultStr += "DemoClient :" + response.DemoClient + " (if ClientType=0 then the Client Type is real . else if ClientType=1 then the Client Type is Demo) " + "<br/>"

resultStr += "IsReadOnly :" + response.isReadOnly + "<br/>"

resultStr += "Second Name :" + response.SName + "<br/>"

resultStr += "Third Name :" + response.TName + "<br/>"

$("#resultData").html(resultStr);

}

}

function onErrorResult(result) {

alert('Service call faild : ' + result.status + ' ' + result.statusText);

}

$("#btnLogin").click(function () {

$.ajax({

url: urlStr + "/Login",

data: { "username": $("#txtusername").val(), "password": $("#txtpassword").val() },

traditional: true,

crossDomain: true,

dataType: "jsonp",

success: onSuccessResult,

error: onErrorResult

});

});

});

</script>

<body >

<table border="1px">

<tbody>

<tr>

<td>

username: <input type="text" id="txtusername" value="support"/>

password: <input type="text" id="txtpassword" value="support"/>

<button id="btnLogin"> Login </button>

</td>

</tr>

</tbody>

</table>

<div id="resultData"> </div>

<div id="resultAction"> </div>

<div style="display:none" id="progress">Loading ... </div>

</body>

</html>


Thanks for your post, Please don't hesitate to contact me if you need any further help.

somilshah
07-11-2014, 11:36 AM
Hello Hassan,

Thank you for your reply, can you help us to know how can have the following code in JSON format as we are developing a mobile application and JSON is required to do so by our team.


Many Thanks,
Somil Shah

Hassan-HS
07-11-2014, 03:21 PM
Hello,

You are welcome, Sure i will assist you in how to send the requests to the server using the web service.


Required Knowledge and Skills (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1926)

somilshah
07-13-2014, 12:29 PM
Hello Hassan,

Thank you for your reply once again, The hyperlink you have mde for Required Knowledge and Skills is not working I request you to re-posit it.

Also we are using the following WCF Service link: http://159.253.137.70/webtrader/WebService.svc

We are not able to get any reply from this WCF Service Link, my developers are working with java and objective C.

I request you to please once again check on the Service Link and provide me with the guidance to get reply from the Web Services link above using any of the above languages.


I will look forward for your fastest reply with a resolution to our issue.


Many Thanks,
Somil Shah

Hassan-HS
07-13-2014, 04:51 PM
Hello,

Sorry you can check it now.

Required Knowledge and Skills (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1926)


You web service is working fine.


login sample:
please fill the stars with valid username and password you will get response with the client parameters.


http://159.253.137.70/webtrader/WebService.svc/Login?username=****&password=****

somilshah
07-14-2014, 12:38 PM
Hello Hassan,

Thank you once again for your reply, Same like this login web api url,
We need the web api urls for all the web services mentioned in the document.

It would be great if you could help us with all of the above doubts with a solution to it.


Many Thanks,
Somil Shah

Hassan-HS
07-14-2014, 04:42 PM
Hello...

I will update you soon please standby

somilshah
07-14-2014, 10:37 PM
Hi Hassan,

Thank you for your reply, We will wait for your reply soon for us to move further.


Many Thanks,
Somil Shah

Hassan-HS
07-15-2014, 10:35 AM
Hello,



1) Server List
-- List of servers available. Eg( ASIA/UK, DEMO, REAL, )
Input
-- method_name
Output
-- List of server with server_name,server_id




http://XXX.XXX.XXX.XXX/webtrader/WebService.svc
Using this code you can access the WCF, but there is no method that return the list of the servers.




2) Login:
To login into the application we need to request the username and password
Input:
-- method_name,user_name,password,server_name or server_id
Output:
-- user_id,user_name

Method documentation (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1949)


http://159.253.137.70/webtrader/WebService.svc/Login?username=****&password=****





3) List of Symbols:
Need list of symbols available for Forex,Commodities,Indices and Equity CFDs

Method Documentation (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1944)


http://159.253.137.70/webtrader/WebService.svc/GetSymbol?******



4) List of All Symbols:
Method documentation (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1935)


http://159.253.137.70/webtrader/WebService.svc/GetAllSymbols?AccountID=*****



5) Get Quotes for All types of Instrumental Types and Favorites

Method Documentation (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1939), Note that to put this in timer to fitch the prices from the server on each tick.

http://159.253.137.70/webtrader/WebService.svc/GetNewTick?


6) Get quotes for individual Instrument Types and Favorites
you cant fetch the prices for specific symbol, you have to fetch all prices for all symbols.


7) Change Order Instrument Types / Favorites

I'm not sure that I understood this point, what do you mean with change the order type?


8) Delete Order Instrument Types / Favorites
1-Method documentation (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1931)
2-Method documentation (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1932)


' To cancel Limit orders
http://159.253.137.70/webtrader/WebService.svc/CancelLimitOrder?AccountId=****&OrderId=*****"
'To cancel SLTP Orders
http://159.253.137.70/webtrader/WebService.svc/CancelSLTP?AccountId=****&OrderId=*****"



9) New Order
New Limit Order documentation (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1950)
New SLTP Order documentation (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1951)
New Market Order documentation (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1952)



'New Limit Order
http://159.253.137.70/webtrader/WebService.svc/NewLimitOrder?AccountId=******&SymID=********&LimitType=*******&Price=*******&lots=****&SL=****&TP=****
'New SLTP Order
http://159.253.137.70/webtrader/WebService.svc/NewManageSLTP?AccId=*****&OrderId=*****&Lots=****TP=*****&SL=****
'New Market Order
http://159.253.137.70/webtrader/WebService.svc/NewOrder?AccountId=****&Symbol=*******&BuySell=******&lots=******





10) View Order
Get Open Positions documentation
(http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1941)

Get Pending Orders documentation (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1942)


' to show open positions
http://159.253.137.70/webtrader/WebService.svc/GetOpenPositions?AccountId=****
' to show pending orders
http://159.253.137.70/webtrader/WebService.svc/GetPendingOrders?AccountId=***




11) Close Order
Method documentation (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1929)


http://159.253.137.70/webtrader/WebService.svc/CloseOrder?AccountId=****&Lots=**&TicketId=*******





History
Method documentation (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1938)



http://159.253.137.70/webtrader/WebService.svc/GetHistory?AccountId=****&FromDate=********&ToDate=**********





Chart
Method documentation (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1948)



http://159.253.137.70/webtrader/WebService.svc/GetChartData?Symbol=****&PeriodID=********&AfterDate=**********







Get Public News documentation (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1946)

Get Private News documentation (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1947)



http://159.253.137.70/webtrader/WebService.svc/GetPublicNews?
http://159.253.137.70/webtrader/WebService.svc/GetPrivateNews?




As you see you can send your request as following

WebServiceLink/MethodName?Pram1&Param2.......

somilshah
07-15-2014, 11:40 AM
Hello Hassan,


Thank you for your reply and the valuable comments sent with the information. I will forward this above to my team and get back to you with the update.


Many thanks,
Somil Shah

somilshah
07-31-2014, 10:09 AM
Hi Hassan,

I would like to know how can we check the results for the WCF API to know result of each action performed.


Many Thanks,
Somil Shah

somilshah
07-31-2014, 11:14 AM
Hello Hassan,

I have been provided with a few doubts and comments on the document we shared a few days back. I request you to please go through the document and provide us with a reply to clarify our doubts.

Please check the attachment below to find the document.

I will Look forward for an immediate reply from you.


Many Thanks,
Somil Shah

Hassan-HS
08-01-2014, 12:15 AM
Dear Somil,

According to fourm terms, we can deal with one inquiry at a time, please add them one by one.


Can you please tell me if you signed the ISV agreement with HS?

Hassan-HS
08-01-2014, 12:17 AM
Dear Somil,

Please check this link (http://hybrid-solutions.com/sales/partnership/isv-program.html)

somilshah
08-01-2014, 10:53 PM
Hi Hassan,

Our Director Mr. Gaurang Ratnagar has signed a agreement with you for the ISV 17 Jun 2014.

You can reply us one by one on our query. I will look forward for you reply as soon as possible so that we can deliver with the solution to connect with you.


Many Thanks,
Somil Shah

Hassan-HS
08-02-2014, 07:33 AM
Dear Somil,


- Please provide a sample user name and password.

This sample is for login with this credentials (username:USER2556 password:GSVI ).


http://159.253.137.70/webtrader/WebService.svc/Login?username=USER2556&password=GSVI

Hassan-HS
08-02-2014, 07:36 AM
- We are trying to put some symbol in this webservices but it doesn’t work perferly.
EX :http://159.253.137.70/webtrader/WebService.svc/GetSymbol?USD

Please check the description of calling result value using this link (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1964).

Hassan-HS
08-02-2014, 07:39 AM
4) How to get list of all symbols:


http://159.253.137.70/webtrader/WebService.svc/GetAllSymbols?AccountID=100126

Note: you must login before using this method.


http://159.253.137.70/webtrader/WebService.svc/Login?username=USER2556&password=GSVI

Hassan-HS
08-02-2014, 07:43 AM
5) Get Quotes for All types of Instrumental Types and Favorites


http://159.253.137.70/webtrader/WebService.svc/GetNewTick?
The GetNewTick operation checks if any symbol data changed and returns a List(of Symbols) which holds all Symbols with their corresponding Bid/Ask, High/Low and Quote time.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>GetNewTick</title>

<script src="http://code.jquery.com/jquery-latest.js"></script>

</head>

<script >

var urlStr = "http://74.54.46.178/vertexweb10/WebService.svc";

function startGetNewTick() {

$.getJSON(urlStr + "/GetNewTick?callback=?", onSuccessResultAction);

}

function onSuccessResultAction(dataResult) {

result = eval('(' + dataResult + ')');

if (result == -201) {

var errDetail = "http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1964"

$("#resultAction").html("Error Code : " + dataResult + "<br/>" + " for more details see the follwing link: " + errDetail.link(errDetail));

}

if (result.Symbols.length > 0) {

var myTable = '<table border="1px"><thead>' +

'<tr><th>Symbol </th><th> Bid</th>' +

'<th >Ask</th><th>High</th><th>Low</th><th>Time</th></tr></thead><tbody>';

for (var i = 0; i <= result.Symbols.length - 1; i++) {

myTable += "<tr>"

myTable += "<td>" + result.Symbols[i].I + "</td>"

myTable += "<td>" + result.Symbols[i].A + "</td>"

myTable += "<td>" + result.Symbols[i].B + "</td>"

myTable += "<td>" + result.Symbols[i].H + "</td>"

myTable += "<td>" + result.Symbols[i].L + "</td>"

//myTable += "<td>" + result.Symbols[i].LastQuoteTime + "</td>"

myTable += "</tr>"

}

myTable += '</tbody></table>';

$("#resultAction").html(myTable);

}

else { $("#resultAction").html("No Price Update"); }

setTimeout('startGetNewTick()', '2000');

}

$(document).ready(function () {

jQuery.support.cors = true;

$("#progress").ajaxStart(function () { $(this).css("display", "block"); });

$("#progress").ajaxComplete(function () { $(this).css("display", "none"); });

function onSuccessResult(response) {

response = eval('(' + response + ')')

if (response.UserId == -1 || response.UserId == -207) {

$("#resultData").html("Invalid username or password");

}

else if (response.UserId == -231) {

$("#resultData").html("You must have at least one account");

}

else if (response == null || response == "" || response.UserId < 0) {

$("#resultData").html("Error while login.Please try later");

}

else {

$("#resultData").html("SuccessResult ... UserId is :" + response.UserId);

}

}

$("#resultAction").ajaxError(function (result) { $(this).html('An error occured'); });

function onErrorResult(result) {

alert('Service call faild : ' + result.status + ' ' + result.statusText);

}

$("#btnLogin").click(function () {

$.getJSON(urlStr + "/Login?username=" + $("#txtusername").val() + "&password=" + $("#txtpassword").val() + "&callback=?", onSuccessResult);

});

$("#btnAction").click(function () {

startGetNewTick();

});

});

</script>

<body>

<table border="1px">

<tbody>

<tr>

<td>

username: <input type="text" id="txtusername" value="support"/>

password: <input type="text" id="txtpassword" value="support"/>

<button id="btnLogin"> Login </button>

</td>

</tr>

<tr>

<td>AccountID: <input type="text" id="txtAccountID" value ="12347298" /> </td>

<td><button id="btnAction"> Start GetNewTick </button></td>

</tr>

</tbody>

</table>

<div id="resultData"> </div>

<div id="resultAction"> </div>

<div style="display:none" id="progress">Loading ... </div>

</body>

</html>




That means you have to call this method on each XXX milliseconds to get the prices.

Hassan-HS
08-02-2014, 07:53 AM
Finally, please note that any WCF application needs to have special approval from HS legal department according to the ISV agreement before going live.

Hassan-HS
08-02-2014, 07:58 AM
Dear somil,

Please contact OTradeTech dealing room to get a account with full privilege, since any requesting operation have to be authenticated before

somilshah
08-04-2014, 12:19 AM
Hello,

Hassan our Director Mr. Gaurang has signed the ISV form with you.

I request you to please reply us as soon as possible you can respond our query handling on single at a time.


Many Thanks,
Somil Shah

somilshah
08-04-2014, 12:25 AM
Hi Hassan,

I will ask OTrade to followup with you for this as we are only doing the development for this mobile application for them.


Many Thanks,
Somil Shah

somilshah
08-04-2014, 10:26 AM
Hi Hassan,

Can you please reply me with the solution for other questions also asked in the document.


Many Thanks,
Somil Shah

somilshah
08-04-2014, 10:27 AM
Hi Hassan,

Can you please reply me with the solution for other questions also asked in the document.


Many Thanks,
Somil Shah

Hassan-HS
08-04-2014, 01:15 PM
Hi Somil

I'm already answered your all questions :) , in next please make sure to post your issues one by one (NO ATTACHMENTS)

somilshah
08-05-2014, 11:37 AM
Hello Hassan,

We are currently using the API provided by you which is WCF Method to pass the command while developing the application. at the moment the major issue we have found is the api checks for the login details in session/cookies to authenticate and while developing a mobile application this would not be possible.

We need modification in this api insteard of checking the login details in session/cookies.. need to authenticate using AccountID

Can you please do the modification or provide us with a solution to this so that we can use the WCF API and Method provided by you to the Mobile Application.

Hassan-HS
08-06-2014, 06:31 AM
Hello :D,


This feature is illogical, because if anyone knows my account number can do trade for example.

somilshah
08-06-2014, 10:57 AM
Hi Hassan,

Thank you for your reply

This would not be based on account number but first a login would be done and then further after authentication all command to WCF would be sent using the account number.

Can you please help us then how do we work this with the current WCF API as when we send the command to WCF for login it is completed and the next command sent shows and error message which is login required.


Many Thanks,
Somil Shah

somilshah
08-06-2014, 12:28 PM
Hello Hassan,

Can you us provide the web api in POST method so that we can work on it integrating with the Mobile Application.


Looking forward for your reply.


Many Thanks,
Somil shah

Hassan-HS
08-06-2014, 01:01 PM
Hello,

Can you please clarify what do you want exactly, I see that most functions already used the account ID

please check the following sample...


' Login with your credentials
http://159.253.137.70/webtrader/WebService.svc/Login?username=USER2556&password=GSVI
' Take 1 lot of silver(the symbol ID for silver is 10) with AccountID ("100126") which is belong to your client ("USER2556")
http://159.253.137.70/webtrader/WebService.svc/NewOrder?AccountId=100126&Symbol=10&BuySell=1&lots=1


to check if the order is taken, please login here (http://159.253.137.70/webtrader/Default.aspx).

somilshah
08-06-2014, 03:28 PM
Hello Hassan,

Yes, I do agree when using these code to make command on the browser it works but when we add them to the application it does not work and provides as error due to the reason WCF API uses sessions/ cookies to store authentication and in term of application it is not possible to do this.

As you would be aware once the authentication takes place in an application then only further commands are been passed like Requesting Quotes or Placing Order or Account Information.

The method we are using now is Get Method can you provide us with the WCF API in POST method and their command too as provided now.


I will look forward for your reply.


Many Thanks,
Somil Shah

Hassan-HS
08-06-2014, 03:32 PM
Hello,

Please not that you have to use "GET" method.

somilshah
08-07-2014, 03:32 AM
Hello,

Please not that you have to use "GET" method.


Hello Hassan,

Thank you for your reply once again, Can you please help us to know how do we store Sessions/ Cookes everytime when we make a new command using GET Method with the application we are developing on Andriod and Iphone.

It there is alternative way using which we can use GET method and still get the application working please do explain.

It would be great help if you could resolve this query of our.

Looking forward for your reply.


Many Thanks,
Somil Shah

Hassan-HS
08-07-2014, 11:19 AM
Hello,



Thank you for your reply once again, Can you please help us to know how do we store Sessions/ Cookes everytime when we make a new command using GET Method with the application we are developing on Andriod and Iphone.


We can't help with this issue here, sorry. You'll need to contact mobile specialist for support.

somilshah
08-08-2014, 06:08 AM
Hello Hassan,

We have got the Session / Cookies issues solved and everything seems to be working fine now.

Can you please make a few more clarification for the screens we are building


List of Symbols:

==> Got List of Symbols but,How to Differentiate Symbols Based on Favorites, Forex, Commodities, Indices, Equity CFDs - Hence we need to display by Instrument Type


Get Quotes for All types of Instrumental Types and Favorites:

==> Please provide List of updated values for GetNewTick for Favorites, Forex, Commodities, Indices, Equity CFDs - by Separate.[Not Single Symbol - Need Bulk of symbols for Forex,Indices etc...]

==> How to add favorites to server - Need to Save Favorites Symbols of User


NEWS

==> Can you provide sample news to display for both public and private.


HISTORY

==> Please provide the Date format we need to send for getting history

==> Please provide summary of all Equity and P/L - values

==> Please provide summary of all Balance, P/L, Margin, Equity, Margin Level, Free Margin - values

Hassan-HS
08-08-2014, 04:29 PM
Hello,



List of Symbols:
==> Got List of Symbols but,How to Differentiate Symbols Based on Favorites, Forex, Commodities, Indices, Equity CFDs - Hence we need to display by Instrument Type



Get Quotes for All types of Instrumental Types and Favorites:

==> Please provide List of updated values for GetNewTick for Favorites, Forex, Commodities, Indices, Equity CFDs - by Separate.[Not Single Symbol - Need Bulk of symbols for Forex,Indices etc...]



There is no methods already do this,however I will check the possibility of adding this feature.
Any way I believe that you can make your own filtering according to list prepared in cooperation with the owner of the system.

Hassan-HS
08-08-2014, 04:30 PM
Hello,


==> How to add favorites to server - Need to Save Favorites Symbols of User


You can do this client side using cookies or cache.

Hassan-HS
08-08-2014, 04:30 PM
Hello,




NEWS

==> Can you provide sample news to display for both public and private.


Get Public News documentation (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1946)

Get Private News documentation (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1947)



http://159.253.137.70/webtrader/WebService.svc/GetPublicNews?
http://159.253.137.70/webtrader/WebService.svc/GetPrivateNews?

Hassan-HS
08-08-2014, 04:31 PM
==> Please provide the Date format we need to send for getting history

It must be in dd/MM/yyyy format.

Hassan-HS
08-08-2014, 04:31 PM
==> Please provide summary of all Equity and P/L - values

==> Please provide summary of all Balance, P/L, Margin, Equity, Margin Level, Free Margin - values

Please check this article (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1953).

somilshah
08-12-2014, 08:26 PM
Hello,






There is no methods already do this,however I will check the possibility of adding this feature.
Any way I believe that you can make your own filtering according to list prepared in cooperation with the owner of the system.



---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Hello Hassan,

Thank you for your reply once again, can you please explain us at the moment as we can see in the application prepared by O-Sense they are also be able to add this feature and make the filtering as the broker have created their groups for symbols. We would like to do the same thing. We are sure you would have an idea what kind of filtering they have used and how they do this as we did a complete study of the services reply received by the reply for GetSymbol but unable to find a way but very much sure you can find a solution for us and help us to replicate the groups which are found on the desktop platform for each client could implemented on this mobile platform too..


I will look forward for a positive and fast reply from you.



Many Thanks,
Somil Shah

Hassan-HS
08-13-2014, 10:09 AM
Hello,


I can assure you that you can not apply this feature(If you mean that you want to build the tree of symbols) using the current version of the API.

note that I will open a suggested feature ticket with this issue to our development team.

stgh5768
10-30-2014, 06:09 AM
thanks u for these infos...

somilshah
11-11-2014, 01:33 PM
Hello Hassan,

Thank you for the support for developing the application for our client.
We have found an issue with one of the commands while testing the application and would like you help us on it.

New Limit Order

We used the above command link to place the order

http://159.253.137.70/webtrader/WebService.svc/NewLimitOrder?AccountId=100120&SymID=AUDUSD&LimitType=BUY&Price=0.8636&lots=0.1&SL=0.8636&TP=0.8637

Over here in this link once we did the log in and then placed this command but we found an error in the browser.
Below was the login link we used - http://159.253.137.70/webtrader/WebService.svc/Login?username=MAE2&password=1234

Once we placed the New Order command link the error in the window we found was below -

{"ExceptionDetail":{"HelpLink":null,"InnerException":null,"Message":"Input string was not in a correct format.","StackTrace":" at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)\u000d\u000a at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)\u000d\u000a at System.ServiceModel.Dispatcher.QueryStringConverte r.ConvertStringToValue(String parameter, Type parameterType)\u000d\u000a at System.ServiceModel.Dispatcher.JsonQueryStringConv erter.ConvertStringToValue(String parameter, Type parameterType)\u000d\u000a at System.ServiceModel.Dispatcher.UriTemplateDispatch Formatter.DeserializeRequest(Message message, Object[] parameters)\u000d\u000a at System.ServiceModel.Dispatcher.CompositeDispatchFo rmatter.DeserializeRequest(Message message, Object[] parameters)\u000d\u000a at System.ServiceModel.Dispatcher.DispatchOperationRu ntime.DeserializeInputs(MessageRpc& rpc)\u000d\u000a at System.ServiceModel.Dispatcher.DispatchOperationRu ntime.InvokeBegin(MessageRpc& rpc)\u000d\u000a at System.ServiceModel.Dispatcher.ImmutableDispatchRu ntime.ProcessMessage5(MessageRpc& rpc)\u000d\u000a at System.ServiceModel.Dispatcher.ImmutableDispatchRu ntime.ProcessMessage41(MessageRpc& rpc)\u000d\u000a at System.ServiceModel.Dispatcher.ImmutableDispatchRu ntime.ProcessMessage4(MessageRpc& rpc)\u000d\u000a at System.ServiceModel.Dispatcher.ImmutableDispatchRu ntime.ProcessMessage31(MessageRpc& rpc)\u000d\u000a at System.ServiceModel.Dispatcher.ImmutableDispatchRu ntime.ProcessMessage3(MessageRpc& rpc)\u000d\u000a at System.ServiceModel.Dispatcher.ImmutableDispatchRu ntime.ProcessMessage2(MessageRpc& rpc)\u000d\u000a at System.ServiceModel.Dispatcher.ImmutableDispatchRu ntime.ProcessMessage11(MessageRpc& rpc)\u000d\u000a at System.ServiceModel.Dispatcher.ImmutableDispatchRu ntime.ProcessMessage1(MessageRpc& rpc)\u000d\u000a at System.ServiceModel.Dispatcher.MessageRpc.Process( Boolean isOperationContextSet)","Type":"System.FormatException"},"ExceptionType":"System.FormatException","Message":"Input string was not in a correct format.","StackTrace":" at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)\u000d\u000a at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)\u000d\u000a at System.ServiceModel.Dispatcher.QueryStringConverte r.ConvertStringToValue(String parameter, Type parameterType)\u000d\u000a at System.ServiceModel.Dispatcher.JsonQueryStringConv erter.ConvertStringToValue(String parameter, Type parameterType)\u000d\u000a at System.ServiceModel.Dispatcher.UriTemplateDispatch Formatter.DeserializeRequest(Message message, Object[] parameters)\u000d\u000a at System.ServiceModel.Dispatcher.CompositeDispatchFo rmatter.DeserializeRequest(Message message, Object[] parameters)\u000d\u000a at System.ServiceModel.Dispatcher.DispatchOperationRu ntime.DeserializeInputs(MessageRpc& rpc)\u000d\u000a at System.ServiceModel.Dispatcher.DispatchOperationRu ntime.InvokeBegin(MessageRpc& rpc)\u000d\u000a at System.ServiceModel.Dispatcher.ImmutableDispatchRu ntime.ProcessMessage5(MessageRpc& rpc)\u000d\u000a at System.ServiceModel.Dispatcher.ImmutableDispatchRu ntime.ProcessMessage41(MessageRpc& rpc)\u000d\u000a at System.ServiceModel.Dispatcher.ImmutableDispatchRu ntime.ProcessMessage4(MessageRpc& rpc)\u000d\u000a at System.ServiceModel.Dispatcher.ImmutableDispatchRu ntime.ProcessMessage31(MessageRpc& rpc)\u000d\u000a at System.ServiceModel.Dispatcher.ImmutableDispatchRu ntime.ProcessMessage3(MessageRpc& rpc)\u000d\u000a at System.ServiceModel.Dispatcher.ImmutableDispatchRu ntime.ProcessMessage2(MessageRpc& rpc)\u000d\u000a at System.ServiceModel.Dispatcher.ImmutableDispatchRu ntime.ProcessMessage11(MessageRpc& rpc)\u000d\u000a at System.ServiceModel.Dispatcher.ImmutableDispatchRu ntime.ProcessMessage1(MessageRpc& rpc)\u000d\u000a at System.ServiceModel.Dispatcher.MessageRpc.Process( Boolean isOperationContextSet)"}


It would be great if you could help us to understand the error as we did browse through all of the common errors but yet not able to find the correct way to do it.
I request you to please send me the correct format in which we should submit the above link to place the order in the above account which we have sent you.

I will look forward for you reply soon.
Thank you
Somil Shah

Hassan-HS
11-11-2014, 03:55 PM
Hello,

You have to pass the variables as it's type, check the correct sample:



http://159.253.137.70/webtrader/WebService.svc/Login?username=MAE2&password=1234
http://159.253.137.70/webtrader/WebService.svc/NewLimitOrder?AccountId=100120&SymID=6&LimitType=1&Price=1.24084&lots=0.1&SL=1&TP=3

somilshah
11-12-2014, 06:52 AM
Hello Hassan,

Thank you very much for your quick reply, the link is working properly now I would like to know how did you get the Symbol ID we are quiet confused to get this as there are lot of symbols we can see approximately 200 plus symbols they have on their system.

I will look forward for your reply.


Thank you,
Somil Shah

Hassan-HS
11-12-2014, 09:57 AM
You are welcome,


check this article (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1935)please

somilshah
11-17-2014, 07:47 AM
Hi Hassan,

Thank you for you reply. We have found another issue with our testing with the product we have developed.

For all the three,

Orders
-----------
1) New Limit Order

2) New SLTP Order


3) New Market Order


When we try to pass the values like,


http://159.253.137.70/webtrader/WebService.svc/NewLimitOrder?AccountId=100119&SymID=160&LimitType=1&Price=36078.0&lots=0.1&SL=36077.0&TP=36079.0



We have tried with SL and TP with 0.00 as values.

Error Code:
-----------

{"d":"\"-228\""}

Most of the time we are facing this,Please let us know what this error means, how to avoid and to place new order.
It would be good if you can guide us with the correct step to solve this issue and make the software workable as desired.

somilshah
11-18-2014, 06:51 AM
Hi Hassan,

I am looking for reply for our doubts posted in our post yesterday.
Request you to reply at the earliest possible.

Many thanks,
Somil Shah

Hassan-HS
11-18-2014, 10:11 AM
Hello,



1) New Limit Order

2) New SLTP Order


-228 means that you sent an invalid price.



3) New Market Order
-228 means the dealer rejected your market order

somilshah
11-28-2014, 10:25 AM
Hi Hassan,

We are having a new issue we are trying to close the TP and SL for an Order but we are getting and error - {"d":"\"-204\""} -- Error Code
When we are trying to access using the link - http://159.253.137.70/webtrader/WebService.svc/CancelSLTP?AccountId=100119&OrderId=48309


This is the AccountId=100119 & OrderId = 48309 / 48307

Request you to help us to solve this error and understand it.

I will look for your reply as soon as possible.


Many Thanks,
Somil Shah

Hassan-HS
11-29-2014, 01:20 PM
Hello Shah,

To check the description of the errors code please visit this link http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1964

FIB109
12-08-2014, 06:01 AM
Salut,Hassan!

FIB109
12-11-2014, 04:14 AM
Why i can't see my reply?





---------------------------------------------------------
Accessoires Mobile (http://www.coquebox.com)
etui iPhone 6 (http://www.coquebox.com/category-accessoires-pour-iphone-1.html)

Hassan-HS
12-11-2014, 07:25 AM
Hello FIB :D ,



Salut,Hassan!


Sorry i thought it a spam, how may i help you bro