Topics
Replies
mindbreaker
17 Feb 2017, 16:39
// Parse a Number from Exponential Notation Double.Parse(string); or decimal d = Decimal.Parse("1.2345E-02", System.Globalization.NumberStyles.Float); or decimal d = Decimal.Parse("1.2345E-02", System.Globalization.NumberStyles.Any);
@mindbreaker
mindbreaker
17 Feb 2017, 15:08
( Updated at: 21 Dec 2023, 09:20 )
Spotware account error data connect api deals
Hi when i get deals with connect Api i've got error on one account on second not (on this same script)???
@mindbreaker
mindbreaker
17 Feb 2017, 12:44
Hi Spotware,
how get closed positions with connect Accounts Api ?
And why
[executionPrice] => 0
in second array [1] ?
( [dealId] => 19075744 [positionId] => 7980418 [orderId] => 12787961 [tradeSide] => BUY [volume] => 100000 [filledVolume] => 100000 [symbolName] => GBPUSD [commission] => -3 [executionPrice] => 1.2428 [baseToUsdConversionRate] => 1.2428 [marginRate] => 1.17765 [channel] => cAlgo [label] => [comment] => [createTimestamp] => 1487151222993 [executionTimestamp] => 1487151223210 [positionCloseDetails] => ) [1] => Array ( [dealId] => 19075666 [positionId] => 7980418 [orderId] => 12787961 [tradeSide] => BUY [volume] => 100000 [filledVolume] => 0 [symbolName] => GBPUSD [commission] => 0 [executionPrice] => 0 [baseToUsdConversionRate] => 1.2428 [marginRate] => 1.17736 [channel] => cAlgo [label] => [comment] => [createTimestamp] => 1487151007973 [executionTimestamp] => 1487151008187 [positionCloseDetails] => )
How work deals ?
@mindbreaker
mindbreaker
16 Feb 2017, 18:56
Last question:
Is it possible refresh allowed and connected accounts to application cTID (if i add next account to my playground i dont see new account on old access token) ?
Or maybe i need refresh old token?
Bye, works fine.
@mindbreaker
mindbreaker
16 Feb 2017, 18:44
Spotware connect Api error
Is the broker has the ability to block access to positions from connectApi and FIX ?
@mindbreaker
mindbreaker
16 Feb 2017, 18:33
( Updated at: 21 Dec 2023, 09:20 )
SPotware connect Api error
Hi,
This connect api does not work (sometime shows positions sometime not)
Send empty data (but i've got open positions )
@mindbreaker
mindbreaker
16 Feb 2017, 10:08
RE:
Spotware said:
There is no reason to refresh the token earlier. The refresh time is 2628000s and not 2s. Regarding the login window, it is a typical open authentication process. Please have a look at https://en.wikipedia.org/wiki/OAuth
When I connect from url with Api, i can't connect often than 2s, to spotware serwers ( error 429 ) not refresh time.
Thanks again bye.
@mindbreaker
mindbreaker
16 Feb 2017, 09:25
RE:
Spotware said:
The expiry time is in seconds
Hi,
Can I refresh token earlier ?
And why refresh time is only 2s when i use Accounts connect Api (in forex world is incredible it is an eternity)
When i want refresh 10 account and get from them positions it is 20 sec.
And why this login window (with cTID) It is not part of the application ( and open in browser - it is stupid idea and annoying - I think so stop using this platform)
Or how to disable it ?
@mindbreaker
mindbreaker
15 Feb 2017, 14:07
RE: RE: RE:
Thanks
But is it possible to create position label in FIX ???
@mindbreaker
mindbreaker
15 Feb 2017, 12:26
See my cBots examples for help:
https://github.com/breakermind/cAlgoRobotsIndicators
@mindbreaker
mindbreaker
15 Feb 2017, 12:24
// SL 50 Pips TP 200 Pips PlaceStopOrder(TradeType.Buy, Symbol, Volume, Symbol.Bid + (75 * Symbol.PipSize), label, SL, TP);
@mindbreaker
mindbreaker
15 Feb 2017, 12:20
API guide:
/api/guides/trading_api#el6
I think SL and TP is in Pips
/api/reference/robot/placelimitorder
public TradeResult PlaceLimitOrder(TradeType tradeType, Symbol symbol, long volume, double targetPrice, string label, double? stopLossPips, double? takeProfitPips)
@mindbreaker
mindbreaker
15 Feb 2017, 12:13
RE:
bernd said:
How can I round my TP and SL targets when I send an order to a certain number of decimals depending on the currency pair? I had an order rejected as per log below because of the long decimals on TP and SL.
Limit order to Buy NZD 84k NZDJPY (Price: 81.903, SL: 48.1499999999997, TP: 6.34999999999997) is REJECTED with error "INVALID_REQUEST"
For example for NZDJPY I want to round TP and SL to 3 decimals.
Thanks
Search in google: C# round
and first pahe from microsoft show what you need (its only C# )
Console.WriteLine(Math.Round(decValue, 2)); Console.WriteLine(Math.Round(decValue, 2, MidpointRounding.AwayFromZero));
@mindbreaker
mindbreaker
15 Feb 2017, 11:10
RE:
NOTE: please bear in mind that access tokens have their expiry time. When you get the error message about access token expiration you should generate message to refresh the last one with refresh token request. Please see the details below.
After this message i need refresh token: CH_ACCESS_TOKEN_INVALID The access token provided is invalid. or when ?
{"error":{"errorCode":"CH_ACCESS_TOKEN_INVALID","description":"Invalid access token"}}
What with this expire time
[expiresIn] => 2628000
@mindbreaker
mindbreaker
15 Feb 2017, 10:19
RE:
Spotware said:
When receiving a token you also receive an expires_in value which indicates when the token expires and when does it need to be refreshed
What is it (timestamp seconds or year)?
[expiresIn] => 2628000
And next questions:
1) How to create New Demo Account from api (100k USD, 1:100, hedging) ?
2) How to change Demo Account Balance to initial deposit ?
2) Is it possible to create a accounts limits ?
Example: I want allow set only positions > 1 Lot and < 3 Lot and not more than 5 positions for account or for Symbol, when i open new demo account.
@mindbreaker
mindbreaker
15 Feb 2017, 09:12
Hi in this post there is a library FIX library with all messages from spotware c# sample project:
/forum/fix-api/11178
and project with .dll library
https://github.com/spotware/FIX-API-Sample
@mindbreaker
mindbreaker
14 Feb 2017, 18:41
Just works :) incredible.
How often i need refresh users tokens ?
Thanks for help.
@mindbreaker
mindbreaker
18 Feb 2017, 10:51
Hi,
here connect Api Accounts Api, working example:
https://github.com/fxstar/connectAPI
Bye
@mindbreaker