Go Back   DailyFX Forum > FXCM Products and Services > FXProgrammers > Discussion / Support Forum > Order2Go COM Trading API Support

Reply
 
Thread Tools Rate Thread
  #16 (permalink)  
Old 04-08-2009, 04:52 PM
Member
 
Join Date: Oct 2008
Posts: 474
Nikolay.Gekht is on a distinguished road
Developers reported that the code causing the problem is found. I'll try to schedule this critical update as soon as possible. Since it is not "new feature" and the problem potentially affects a lot of users, it must be possible. Thank you again for your help in finding of this problem!
Reply With Quote
  #17 (permalink)  
Old 04-09-2009, 12:54 PM
parnoldson's Avatar
Member
 
Join Date: Nov 2006
Posts: 30
parnoldson is on a distinguished road
Thank you for looking in to this. I am looking forward to the fix. Keep me posted.

phil
Reply With Quote
  #18 (permalink)  
Old 04-29-2009, 12:07 PM
jlanawalt's Avatar
Member
 
Join Date: Aug 2006
Posts: 112
jlanawalt is on a distinguished road
This appears to be fixed in the latest version, v01.04.041509. I use to get the error at least 25% of the time and after installing that version of the API and rebuilding I have not been able to get the error.
__________________
Jacob Anawalt
Gecko Software, Inc.
Reply With Quote
  #19 (permalink)  
Old 04-29-2009, 06:23 PM
Member
 
Join Date: Oct 2008
Posts: 474
Nikolay.Gekht is on a distinguished road
Thank you!
Reply With Quote
  #20 (permalink)  
Old 05-06-2009, 11:06 AM
Member
 
Join Date: Apr 2009
Posts: 7
netsalonfx is an unknown quantity at this point
COND_DIST system property

I, too, was getting "Price did not pass validation", so I looked it up and found this thread. I assume that my OpenTrade price was not within COND_DIST from the rate quote, so I want to check my user's price before calling the OpenTrade API.

The problem is, the documentation that came with my distribution does NOT list this as a valid system property, and when I tried using the string "COND_DIST" I got an exception with "Unknown name".

What am I missing here? I am trying to call the GetSystemProperty method against the trade desk object with "COND_DIST". I assume it returns a 'double' as that is how the rate quote is returned.

Thanks,

Mitch
Reply With Quote
  #21 (permalink)  
Old 05-06-2009, 12:25 PM
Member
 
Join Date: Oct 2008
Posts: 474
Nikolay.Gekht is on a distinguished road
COND_DIST is the minimal allowed distance between conditional (i.e. stop and limit) order and the current market price (or the entry order price). It does not affect the market rate checking.

For the market order, it is a good style, to either use "open at any market price" (i.e. 0 instead of price for the Open/CloseTrade) or to get the most fresh quote from the offer table. The rules of checking the price are based on the lot of internal things and can't be checked correctly on the client site, but the approach above guarantees that the operation will be executed in most cases.

The server may provide no property in case the limitation is not applicable.

Almost all properties returns the String value. The set of properties depends on the server only, so O2GO can not convert all of them to the right type automatically.
Reply With Quote
  #22 (permalink)  
Old 05-06-2009, 01:35 PM
Member
 
Join Date: Apr 2009
Posts: 6
mitchmcc is an unknown quantity at this point
Properties

Nikolay,

Thanks for the clarification. I also updated my API version
today... that should help(!).

Mitch
Reply With Quote
  #23 (permalink)  
Old 05-12-2009, 01:24 PM
Member
 
Join Date: Apr 2009
Posts: 6
mitchmcc is an unknown quantity at this point
COND_DIST property question

I recently updated my API to version 04152009.

I was trying to use public method TradeDeskAut.GetSystemProperty
to get the COND_DIST (in C#), but when I used "COND_DIST", I got

System.InvalidCastException was unhandled
Message="Specified cast is not valid."


My code looks like this:

Code:
double cond_dist = (double)oTrDesk.GetSystemProperty("COND_DIST");
Since it says "The data type depends on the type of the property" and since it is expressed in pips, I assumed it would return a double.

I also looked in the examples, but could not find anywhere that GetSystemProperty was used in them (I used windows search).
Reply With Quote
  #24 (permalink)  
Old 05-12-2009, 02:22 PM
Member
 
Join Date: Oct 2008
Posts: 474
Nikolay.Gekht is on a distinguished road
GetSystemProperty("COND_DIST") returns string.
Try to use Double.Parse((string)GetSystemProperty("COND_DIST" ), CultureInfo.InvariantCulture)

In order to avoid the problem in the various locales and in case the datatype will be changed the better way is to check the datatype, i.e. do something like this:
object x = GetSystemProperty("COND_DIST");
if (x is int)
cd = (int)x;
else if (x is double)
cd = (double)x;
else
cd = Double.Parse((string)x, CultureInfo.InvariantCulture)

Last edited by Nikolay.Gekht; 05-12-2009 at 02:26 PM..
Reply With Quote
  #25 (permalink)  
Old 05-14-2009, 10:38 PM
Registered User
 
Join Date: Feb 2009
Posts: 3
Sandybestdog is an unknown quantity at this point
My program places the exact same buy and short order when the condition is hit. I specify the same entry amount and stop and limit. It will work fine for several orders and then I'll get a "stop price did not pass validation" which will stop the whole program. How come the exact same order works 5 times in a row and then doesn't? Here is the code.

oTradeDesk1.CreateEntryOrder AcctID, "EUR/USD", True, 1000, EurUsdBuyRate, EurUsdBuyRate - EurUsdFirstStopAmount, EurUsdBuyRate + EurUsdFirstLimitAmount, 0, TrackEurUsdFirstBuy, DealerInt

I think it has something to do with the bid and ask. How do I get it to at least place it at the minimal distance? I just think this is rediculous that it works 5 or 10 times and then it won't work and you have no idea when it's going to happen. I tried to figure out what the distance would be, but it seems to just be stuck at 5, but obviously that changes. I used this code and it always returns 5. Thanks for any help.

Private Sub EntryDistance_Change()
EntryDistance.Text = oTradeDesk1.GetSystemProperty("COND_DIST_ENTRY")

End Sub
Reply With Quote
  #26 (permalink)  
Old 10-05-2009, 06:17 AM
SMI SMI is offline
Member
 
Join Date: Jun 2009
Posts: 10
SMI is an unknown quantity at this point
CreateFixOrder FIX_OPENMARKET "Price did not pass validation"

I keep getting "Price did not pass validation" error when using

oTradeDesk.CreateFixOrder oTradeDesk.FIX_OPENMARKET, 0, 0, 0, 0, strAccount, strinstrument, strBuySell, nLots, 0, 0, 0

I have been using the same code for a very long time but am only recently getting this error.

When I look at the parameters they all look correct.

Please let me know what is causing this error.
Reply With Quote
  #27 (permalink)  
Old 10-05-2009, 11:08 AM
Member
 
Join Date: Oct 2008
Posts: 474
Nikolay.Gekht is on a distinguished road
This is the server-side error message, so:
1) Could you please provide the whole error message, this message is usually followed by the error details like prices.
2) Could you please provide the connection name (is usually visible in the Trading Station's status bar, in 5th indicator, something like Demo:U100D).
Reply With Quote
  #28 (permalink)  
Old 10-06-2009, 03:37 AM
SMI SMI is offline
Member
 
Join Date: Jun 2009
Posts: 10
SMI is an unknown quantity at this point
Error Message Details and Connection Name

1) Please find one example as below:

Run-time error '-2147467259 (80004005)'

Price did not pass validation: A:387872 OF:11 SB:B Q:100000 AM:0 OR: 142.044 2-1176117 CR:142.04401 2-1176117 PR:142.036 2-1176117

I have many other examples which are captured as screenshots. I can send or attach these if you let me know how.

2) The connection name in the status bar is:

dDemo:GBDEMO
Reply With Quote
  #29 (permalink)  
Old 10-06-2009, 03:40 AM
SMI SMI is offline
Member
 
Join Date: Jun 2009
Posts: 10
SMI is an unknown quantity at this point
Adding Error Screenshots

OK...think I have found where to add attachments.

Adding screenshots of some of the instances of this error.

Please see the following attachments

20091002-001.bmp
20091002-002.bmp
20091002-003.bmp
20091002-004.bmp
Attached Images
File Type: bmp 20091002-001.bmp (219.1 KB, 12 views)
File Type: bmp 20091002-002.bmp (219.1 KB, 7 views)
File Type: bmp 20091002-003.bmp (219.1 KB, 5 views)
File Type: bmp 20091002-004.bmp (219.1 KB, 9 views)
Reply With Quote
  #30 (permalink)  
Old 10-06-2009, 02:13 PM
Member
 
Join Date: Oct 2008
Posts: 474
Nikolay.Gekht is on a distinguished road
Thank you for the information. I'll research the cause and will notify about the results immediately.
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




Disclaimer: Trading foreign exchange on margin carries a high level of risk, and may not be suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to trade foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with foreign exchange trading, and seek advice from an independent financial advisor if you have any doubts. Any opinions, news, research, analyses, prices, or other information contained on this website is provided as general market commentary and does not constitute investment advice. Forex Capital Markets LLC. will not accept liability for any loss or damage, including without limitation to, any loss of profit, which may arise directly or indirectly from use of or reliance on such information.

All times are GMT -5. The time now is 10:57 PM.
Copyright ©2009 Daily FX. All Rights Reserved.