Topics
31 Dec 2021, 16:28
 990
 4
15 Mar 2019, 16:44
 4550
 13
28 Feb 2019, 11:28
 1417
 6
14 Jun 2018, 19:00
 1630
 2
14 Jun 2018, 15:14
 1464
 2
12 Apr 2018, 12:41
 1362
 2
07 Nov 2017, 06:42
 1998
 6
24 Oct 2017, 03:38
 2110
 7
17 Oct 2017, 12:08
 0
 912
 1
16 Oct 2017, 08:26
 2381
 5
Replies

ycomp
04 May 2017, 05:27

does this limit apply to the Trading API also?

I never had any problems before creating and closing a bunch of trades one after another, since I started using the trading api.

but today I'm continually getting a socket closed from the trading API - the accounts API works fine from the same program with the same credentials.


@ycomp

ycomp
29 Apr 2017, 17:17

RE:

Spotware said:

Hi ycomp,

1. What is the quoteToDepositConversionRate in ?

It is the conversion rate between the deposit currency and the quote currency at the time that the position was closed. It is used to calculate your profit or loss in your deposit currency.

 

can the quoteToDepositConversionRate ever be 0 ? my guess is no, but I'm asking because if it can be 0 I would get a DIV/0 error


@ycomp

ycomp
24 Apr 2017, 13:56

RE:

Spotware said:

Hi ycomp,

ProtoOASubscribeForTradingEventsReq is used to subscribe to trading events like order filling, canceling, closing etc. It can not be used to receive position information. If you need position information you can do it through Accounts API.

is there any kind of connections per second limit with the Accounts API? or can I hit it as much as I want? 

 


@ycomp

ycomp
20 Apr 2017, 12:21

re: 2, I know how to calculate for Forex pairs but I don't know anything about how CFDs are calculated.

Do you have any info regarding CFDs ? examples how to calculate anything might be useful to me, or at least a description of what a CFD 'pip' is compared to a Forex pip.

For example, a stock index CFD


@ycomp

ycomp
20 Apr 2017, 12:11

thanks


@ycomp

ycomp
20 Apr 2017, 08:20

Hi, can someone answer these questions? thanks... 


@ycomp

ycomp
18 Apr 2017, 08:48

TRADING_BAD_VOLUME

this is unrelated to the previous question

I received a TRADING_BAD_VOLUME, I can't replicate it anymore so I'm not sure why it occured. When trying to close a position.

but the message was "error_code:TRADING_BAD_VOLUME closeVolume 200000 is bigger than position volume 0 for trader (some numbers)"

how can a position have a 0 volume? Does it mean that I closed it already and I'm trying to close it again ?

 

 


@ycomp

ycomp
18 Apr 2017, 07:02

ProtoOAClosePositionDetails: closedVolume

can there be a situation where you send a close request (specifying the full position volume) and the position gets closed only partially? (i.e. ProtoOAClosePositionDetails: closedVolume is less than the volume you specified ? )


@ycomp

ycomp
18 Apr 2017, 06:39

profitInPips

profitInPips is available in the Accounts API, is there any way to get the profit in Pips via the Trading API

1. for closed positons?

2. for open positions?


@ycomp

ycomp
14 Apr 2017, 04:15

RE:

Spotware said:

3) Do you mean Spotware's Demo or a Broker's Demo. It depends on the settings of the broker

Broker Demo - right now I'm testing on Pepperstone, I never could get the sandbox to  work - so I use the Pepperstone broker demo. 

I guess I can just test slippage by setting the baseSlippagePrice away from the current market price

ProtoOACancelOrderReq can be used on any order, but since market orders are filled instalty you can not practically using this.

thanks, I just wanted to make sure sending a cancel request on a market order wouldn't cause problems

 

 


@ycomp

ycomp
13 Apr 2017, 15:38

also are 

ProtoOACancelOrderReq meant to be used only on non-market orders? 

@ycomp

ycomp
05 Apr 2017, 10:31

RE: RE:

mindbreaker said:

ycomp said:

I'd still like to know how to handle the error message when the token is about to expire. That way I won't have to keep track of when the token was initially generated (which I would prefer not to have to do)

Test it! its my old token:
g0gjr3jzeaNqsPXx-AaHv6Ef_SH9E0jRoU8Ut03hmzw



{"error":{"errorCode":"CH_ACCESS_TOKEN_INVALID","description":"Invalid access token"}}

 

thanks - for me this was a stumbing block.. I didn't have any old tokens )


@ycomp

ycomp
04 Apr 2017, 03:22

I'd still like to know how to handle the error message when the token is about to expire. That way I won't have to keep track of when the token was initially generated (which I would prefer not to have to do)


@ycomp

ycomp
03 Apr 2017, 17:09

what is the max. length of a comment for ProtoOACreateOrderReq?

I have a problem with positions not being created if the comment is too long... when I shorten the comment then the positions are created fine.

I tested it with comments with only letters in them so it is not due to invalid characters in the comment, simply the length of the comment.


@ycomp

ycomp
03 Apr 2017, 16:12

RE:

Spotware said:

It is possible to specify Label or Comment only when you execute market order or place pending order.

is label not available via the connect api?

I can only see comment, but not a label field in ProtoOACreateOrderReq


@ycomp

ycomp
03 Apr 2017, 04:23

RE:

mindbreaker said:

Save time (timestamp - php function: time() ) when you create token and then add expired time (286666) in seconds and you know wen token will expire (it is 30 days time).

so I can just request a new token @ 29 days and all is good?


@ycomp

ycomp
30 Mar 2017, 16:57

is there a way to determine if the market is currently tradeable? for instance, market hours is over because it is the weekend ?

if not then what will happen on the weekend? orders just get rejected?


@ycomp

ycomp
30 Mar 2017, 14:06

RE:

Spotware said:

Yes you can use ProtoOAClosePositionReq

in the docs it says "volume" is required, what value should I specify for volume to signify that the entire position should be closed? 0 doesn't work.


@ycomp

ycomp
30 Mar 2017, 14:04

I'm a bit confused as to how to implement heartbeat. I'm gettting heartbeat events, what do I do when I receieve them? 

Do I ever need to actually create a heartbeat event ? I don't really understand why I would need to create one if the server already sends them periodically.

But I don't know how to acknowledge to the server that I recieved the heartbeat event.


@ycomp

ycomp
30 Mar 2017, 13:51

Is there a way to send a close request without specifying the exact volume (and it will just close the entire position)?


@ycomp