Topics
Replies
viniciusfre
18 May 2022, 12:53
RE:
amusleh said:
Hi,
Please read the Open API documentation "Account Authentication" page: Account Authentication - cTrader Open API (spotware.github.io)
Hi,
The problem is that I am not able to find the Playground website. Can you please share the link?
@viniciusfre
viniciusfre
17 May 2022, 20:02
RE: RE:
viniciusfre said:
amusleh said:
Hi,
You can't access the token there, only the application that you authorized can get the token via authentication code.
Hello. I am talking about this information:
CLIID "xxx_mooSCsL7wDYoC1bpsXkrXtKrXePDxDZzoJhcjOP5irXaNBqn7w"
CLSECRET "yyyZL2czQHah4aJ1CIaCksQ3RI2wiEFLBU4s5SuWlDTiuRk7MG"
ACCID 19712xxx
Actually, I also need this:
ACCTOKEN "xxxkyILb-d5wta8OhArqoNM4gK4zoSNrqtejks9Fc"
REFR_TOAKEN "xxxyy4yqu6WV7UL_R8x_ew1Sx7XBo_G1_egfUsVPays"
@viniciusfre
viniciusfre
17 May 2022, 19:59
RE:
amusleh said:
Hi,
You can't access the token there, only the application that you authorized can get the token via authentication code.
Hello. I am talking about this information:
CLIID "xxx_mooSCsL7wDYoC1bpsXkrXtKrXePDxDZzoJhcjOP5irXaNBqn7w"
CLSECRET "yyyZL2czQHah4aJ1CIaCksQ3RI2wiEFLBU4s5SuWlDTiuRk7MG"
ACCID 19712xxx
@viniciusfre
viniciusfre
19 Jan 2021, 14:48
RE:
PanagiotisCharalampous said:
Hi viniciusfre,
Here you go
Trendbars{Open: 2 High: 46 Low: 121568 Close: 41 Timestamp: 26840575 Open: 42 High: 43 Low: 121564 Close: 5 Timestamp: 26840580 Open: 16 High: 28 Low: 121554 Close: 20 Timestamp: 26840585 Open: 2 High: 39 Low: 121572 Close: 9 Timestamp: 26840590 Open: 0 High: 50 Low: 121580 Close: 45 Timestamp: 26840595 Open: 0 High: 43 Low: 121624 Close: 39 Timestamp: 26840600 Open: 2 High: 30 Low: 121662 Close: 23 Timestamp: 26840605 Open: 12 High: 79 Low: 121674 Close: 13 Timestamp: 26840610 Open: 44 High: 48 Low: 121644 Close: 1 Timestamp: 26840615 Open: 5 High: 32 Low: 121641 Close: 15 Timestamp: 26840620 Open: 43 High: 44 Low: 121614 Close: 6 Timestamp: 26840625 Open: 40 High: 46 Low: 121581 Close: 18 Timestamp: 26840630 Open: 0 High: 59 Low: 121599 Close: 36 Timestamp: 26840635 Open: 76 High: 96 Low: 121559 Close: 80 Timestamp: 26840640 Open: 79 High: 80 Low: 121561 Close: 29 Timestamp: 26840645 Open: 64 High: 64 Low: 121524 Close: 24 Timestamp: 26840650 Open: 42 High: 60 Low: 121506 Close: 3 Timestamp: 26840655 Open: 0 High: 52 Low: 121506 Close: 46 Timestamp: 26840660 Open: 0 High: 61 Low: 121549 Close: 37 Timestamp: 26840665 Open: 13 High: 33 Low: 121575 Close: 30 Timestamp: 26840670 Open: 2 High: 69 Low: 121602 Close: 32 Timestamp: 26840675 }}
Best Regards,
Panagiotis
Hi Panagiotis,
I finally figured out the issue. In my read function I was using ParseFromString and it was getting corrupted payload. The correct function is ParseFromArray, after that worked fine.
Thanks for your help and support.
@viniciusfre
viniciusfre
13 Jan 2021, 22:30
( Updated at: 21 Dec 2023, 09:22 )
RE:
PanagiotisCharalampous said:
Hi viniciusfre,
I tried this using the sample project and I get 21 bars.
Make sure there are no issues in your code
Best Regards,
Panagiotis
Looks like I have an issue in my read function. Could please tell me the first 5 or 6 close prices? I dont have PCs with VS to test.
@viniciusfre
viniciusfre
12 Jan 2021, 10:46
( Updated at: 12 Jan 2021, 10:48 )
RE: RE:
viniciusfre said:
PanagiotisCharalampous said:
Hi viniciusfre,
As per the documentation, the format is milliseconds. You can check our .Net Sample.
Best Regards,
Panagiotis
Hi,
I finally figured out the format. it is Unix timestamp in millseconds. Example: from = 1610330400000 to = 1610331300000
I think if the documentation make clear about Unix timestamp in milliseconds, it will help to understand better.
Thanks.
Now I have another issue. I am trying to request 20 or 150 trendbars in M5 period but I only receives sometimes 6, 5 or even 2. For example, for 20 trendbars:
from = 1610434500000; to = 1610440500000
TrendBarRes size = 6 <----
close1: 1.21969
close2: 1.21634
close3: 1.21746
close4: 1.21672
close5: 1.22012
close6: 1.21624
That is 'Tue Jan 12 2021 06:55:00' to 'Tue Jan 12 2021 08:35:00', i.e. 100 minutes / 5 = 20 candles/trendbars. Is there something wrong in the request?
@viniciusfre
viniciusfre
11 Jan 2021, 13:31
RE:
PanagiotisCharalampous said:
Hi viniciusfre,
As per the documentation, the format is milliseconds. You can check our .Net Sample.
Best Regards,
Panagiotis
Hi,
I finally figured out the format. it is Unix timestamp in millseconds. Example: from = 1610330400000 to = 1610331300000
I think if the documentation make clear about Unix timestamp in milliseconds, it will help to understand better.
Thanks.
@viniciusfre
viniciusfre
10 Apr 2019, 17:58
Hi Panagiotis,
The code is mostly based on C# sample. Everything is working fine: send messages and receive messages. Heart beat too.
But CreateAccountListRequest()-->ProtoOAGetAccountListByAccessTokenReq() is the only message is not working and I did not figure out yet.
ProtoMessage OpenApiMessagesFactory::CreateAccountListRequest(string token) { ProtoOAGetAccountListByAccessTokenReq _msg; string msg_str; _msg.set_accesstoken(token); _msg.SerializeToString(&msg_str); return CreateMessage(_msg.payloadtype(), msg_str); }
I am receiving only the token back from server. I was expecting the list of IDs: ctidTraderAccountIds. Any idea what is the issue?
Thanks.
@viniciusfre
viniciusfre
07 Apr 2019, 13:24
In fact the token was correct, but the accountID was wrong. Now I was wondering where do I find CtidTraderAccountId for each account?
@viniciusfre
viniciusfre
30 Mar 2019, 15:24
Hi,
I am building a C++ code in order to use open API 2.0. Do I have connect to ctrader servers using SSL or could be plain text without any encryption?
Is there a flow diagram explaining how to connect to servers?
@viniciusfre
viniciusfre
21 Mar 2019, 12:53
Ok, this is great.
But I was in contact with Pepperstone and apparently they do not even know the difference between FIX API and Open API. They just say: "yes, we support API. Email us and ask to activate API access"... I bet the other brokers also does not know the difference.
So we need that spotware inform them about the Open API and how to give us Open API access.
Thanks.
@viniciusfre
viniciusfre
21 Mar 2019, 11:06
Hi Panagiotis,
Do you know which brokers offer Open API 2.0 or even 1.0?
@viniciusfre
viniciusfre
20 Mar 2019, 15:05
Hi,
I am trying to modify a position for to set Take profit or Stop loss as per Solid Snake steps, but it is not working.
So I am sending first a buy market message:
side = 1(BUY)
_orderType = 1(OrdType_MARKET)
_symbol = 1 (EURUSD)
_orderQty = 1000
_timeInForce = 3(IMMEDIATE_OR_CANCEL)
_price = 0
_stopPx = 0
And then I send a take profit buy message:
side = 2(SELL)
_orderType = 2(OrdType_LIMIT)
_symbol = 1 (EURUSD)
_orderQty = 1000
_timeInForce = 1(GOOD_TILL_CANCEL)
_price = AvgPx + 0.00032 (32 points gain)
_stopPx = 0
PosMaintRptID = X (Value received in ExecutionReport)
Instead mofify the buy position, the server is creating a pending order. What is wrong?
@viniciusfre
viniciusfre
21 Jan 2019, 22:23
RE:
Panagiotis Charalampous said:
Hi viniciusfre,
Thanks for posting in our forum. Trend bar data is not available in FIX API. If you need trend bar data, you can consider Open API.
Best Regards,
Panagiotis
Hi Panagiotis,
One of reasons to use FIX API is because I want to run my robot on Linux. Can I run Open API robot on Linux?
@viniciusfre
viniciusfre
18 May 2022, 12:55
RE: RE:
viniciusfre said:
Opps, sorry, I found it now. But It was not showing to me.
Thanks anyway.
@viniciusfre