Topics
08 Nov 2023, 16:58
 367
 1
16 Jul 2020, 18:05
 1267
 2
04 Jul 2020, 08:34
 2682
 15
15 Jun 2020, 18:25
 1135
 5
10 Jun 2020, 16:18
 2196
 11
02 Mar 2019, 22:39
 1207
 5
11 Feb 2019, 18:35
 1148
 4
13 Feb 2016, 19:30
 2662
 6
30 May 2015, 20:29
 0
 2864
 3
30 Mar 2015, 20:26
 2757
 3
Replies

MZen
08 Nov 2023, 14:53

I experience the same issue with CTrader lately. It is impossible to use it anymore.


@MZen

MZen
08 Nov 2023, 14:52

The same issue! CTrader constantly freeze, especially during news times. The same problem for desktop, mobile and web with two brokers. My internet is fine. 


@MZen

MZen
17 Oct 2023, 03:55

RE: RE: RE: I have the same problem

philip.hynes said: 

Hi Alex,

I managed to fix it after months of trying!!!

You need to find the "api-ms-win-core-sysinfo-l1-2-0.dll" file online (make sure you scan it with virustotal). Then copy it to your windows/system32 folder. Then restart your computer and it works!

I was so happy once I finally fixed it. I hope you have the same success.

Phil.

Hi Phil,

thank you! It works now. 
I greatly appreciate your help!
Alex


@MZen

MZen
16 Oct 2023, 15:49 ( Updated at: 21 Dec 2023, 09:23 )

RE: RE: I have the same problem

PanagiotisChar said: 

MZen said: 

Win7 Pro64, .NET 6 SDK installed
When I press BUILD button nothing happened, but the button is greyed.

Yet, sometimes, not always, I get system message about missing “api-ms-win-core-sysinfo-l1-2-0.dll”


Any ideas how to fix?

Alex

Share your cBot code and maybe a video demonstrating the behavior and I am sure the team will check 

I have Ctrader from two brokers installed. On doesn't show any message when I hit Build button. Another one shows  - see screenshot.


@MZen

MZen
16 Oct 2023, 15:24 ( Updated at: 17 Oct 2023, 03:40 )

RE: RE: I have the same problem

PanagiotisChar said: 

MZen said: 

Win7 Pro64, .NET 6 SDK installed
When I press BUILD button nothing happened, but the button is greyed.

Yet, sometimes, not always, I get system message about missing “api-ms-win-core-sysinfo-l1-2-0.dll”


Any ideas how to fix?

Alex

Share your cBot code and maybe a video demonstrating the behavior and I am sure the team will check 

It happens with any Bot and any Indicator with any framework

 

 

 

 

 

 


@MZen

MZen
16 Oct 2023, 14:22

I have the same problem

Win7 Pro64, .NET 6 SDK installed
When I press BUILD button nothing happened, but the button is greyed.

Yet, sometimes, not always, I get system message about missing “api-ms-win-core-sysinfo-l1-2-0.dll”


Any ideas how to fix?

Alex


@MZen

MZen
19 Jul 2020, 20:37

 

 


@MZen

MZen
18 Jul 2020, 20:51

RE:

It works only in Visual Studio 2019 environment. So, if you are running earlier versions of VS, like I used to do, most likely you will be puzzled to death.


@MZen

MZen
13 Jul 2020, 15:15

RE:

PanagiotisCharalampous said:

Hi MZen,

You are right, my response above was not correct. When the hasMore flag is set to true, it means that the number of records by filter is larger that the ones returned by the message. Therefore you will need to manually request for the rest or break your queries into requests with smaller sizes.

Best Regards,

Panagiotis 

Join us on Telegram

Got it!

Thanks


@MZen

MZen
13 Jul 2020, 13:10

RE:

PanagiotisCharalampous said:

Hi MZen,

Could you please elaborate on how I should read more messages? In the Sample project we have Listener tread, so do you mean I have to watch for more messages as output of Listener?

Yes this is correct. The example project is already programmed to do so.

Best Regards,

Panagiotis 

Join us on Telegram

 

 

So, why there is only one message (10000 ticks) and no more messages? First message has HasMore=true.

Thank you.


@MZen

MZen
12 Jul 2020, 16:15

RE:

PanagiotisCharalampous said:

Hi MZen,

2) ProtoOAGetTickDataRes has a hasMore field. If this is set to true, it means more messages are following. There is nothing you need to do, just read the next messages until hasMore becomes false.
 

Best Regards,

Panagiotis 

Join us on Telegram

 

Could you please elaborate on how I should read more messages? In the Sample project we have Listener tread, so do you mean I have to watch for more messages as output of Listener?

Yet, there is only one message going in response to TickData Request. Only one and it has HasMore = true. However no other messages follows.

I am lost here. Forgive my inexperience.


@MZen

MZen
06 Jul 2020, 14:39

RE:

PanagiotisCharalampous said:

Hi MZen,

You are misundestanding ticks. Ticks represent current offers to buy and sell. In OTC markets executed trades are not available since trading takes place over the counter between two counterparties rather than on a centralized exchange.

Best Regards,

Panagiotis 

Join us on Telegram

Got it.

In CTrader there is last price and volume in tick charts along with current bid-ask. That is why I got confused.

Thank you.


@MZen

MZen
06 Jul 2020, 14:25 ( Updated at: 21 Dec 2023, 09:22 )

RE:

PanagiotisCharalampous said:

Hi MZen,

It is a property of the message. See below

Best Regards,

Panagiotis 

Join us on Telegram

Thank you


@MZen

MZen
06 Jul 2020, 14:22

RE:

PanagiotisCharalampous said:

Hi MZen,

Spot prices streamed through spot events represent exactly what you have described, the latest offers from buyers and sellers. So this is what you are looking for.

Best Regards,

Panagiotis 

Join us on Telegram

Sorry to bother you, but were are ticks? The prices at which transactions occurred?

Thank you


@MZen

MZen
06 Jul 2020, 13:46

RE:

PanagiotisCharalampous said:

Hi MZen,

1) You can add two types to the message. In C# it would look like this

            var _msg = ProtoOAGetTickDataReq.CreateBuilder();
            _msg.SetCtidTraderAccountId(accountId);
            _msg.SetSymbolId(symbolId);
            _msg.SetType(ProtoOAQuoteType.ASK);
            _msg.SetType(ProtoOAQuoteType.BID);
            _msg.SetFromTimestamp(from);
            _msg.SetToTimestamp(to);

2) ProtoOAGetTickDataRes has a hasMore field. If this is set to true, it means more messages are following. There is nothing you need to do, just read the next messages until hasMore becomes false.

Best Regards,

Panagiotis 

Join us on Telegram

 

1) Thank you, I will try this.

2) I just do not see hasMore in MessagesFactory:

        public ProtoMessage CreateTickDataResponse(string clientMsgId = null)
        {
            return CreateMessage((uint)ProtoOAPayloadType.PROTO_OA_GET_TICKDATA_RES, ProtoOAGetTickDataRes.CreateBuilder().Build().ToByteString(), clientMsgId);
        }

Could you clarify it, please.


@MZen

MZen
06 Jul 2020, 13:44

RE:

PanagiotisCharalampous said:

Hi MZen,

You need to subscribe to spot prices using ProtoOASubscribeSpotsReq. Then current bid and ask prices will be streamed to you.

Best Regards,

Panagiotis 

Join us on Telegram

 

Hi,

the spot stream looks like:

Send: ProtoMessage{SubscribeForSpotsRequest{}}
Received: ProtoMessage{SpotEvent{symbolId:1, bidPrice:112961, askPrice:112966}}
Received: ProtoMessage{SubscribeForSpotsResponse{}}
Received: ProtoMessage{SpotEvent{symbolId:1, bidPrice:112962, askPrice:       }}
Received: ProtoMessage{SpotEvent{symbolId:1, bidPrice:       , askPrice:112967}}
Received: ProtoMessage{SpotEvent{symbolId:1, bidPrice:112961, askPrice:       }}
Received: ProtoMessage{SpotEvent{symbolId:1, bidPrice:112962, askPrice:       }}
Received: ProtoMessage{SpotEvent{symbolId:1, bidPrice:       , askPrice:112968}}
Received: ProtoMessage{SpotEvent{symbolId:1, bidPrice:       , askPrice:112967}}
Send: ProtoMessage{UnsubscribeFromSpotsRequest{}}
Received: ProtoMessage{UnsubscribeFromSpotsResponse{}}

in every spot event message there is only one price: Bid or Ask. As I understand, those are spot prices, a.k.a ticks.

Let me clarify: Yes, transactions occur on bid or ask side, yet, current bid and ask - offers from buyers and sellers, can change, sometimes quickly, without  transactions and without spot event generated. So, spot price/tick in API spot event message is NOT current BID nor ASK.

So. the question is not how to get spot price, as you see I got it, but how to get current offers, sitting on bid and ask sides of the current spread.

Thank you


@MZen

MZen
17 Jun 2020, 16:24

RE:

PanagiotisCharalampous said:

Hi MZen,

  1. What execution errors? There should not be any errors when changing the proxy address. To make the code work for both demo and live accounts will add unnecessary complexity to the code and will defeat the purpose, which is to find out how to exchange messages with the server using the API. I don't see why somebody would need to use the sample application with a live account. 
  2. What compilation error? I just read again your question and I am not sure what do you mean. The variable is long and this is what it should be.
  3. I don't get what you mean. If you are working with demo accounts the condition should be false. If you are working with live accounts then it should be true.

Best Regards,

Panagiotis 

Join us on Telegram

This is exactly what I am trying to do, learn how to use API. Yet, demo account does not make sense to me, since my goal is to make it work with real money.

You have included in your sample demo account portion (lines 17 to 23) and real account portion (lines 25 to 30). So, I commented demo and un-commented real portion of the code and started to play with sample. Of course I could not go past authorization of application. I started to debug and here I consistently get exception in the Listener.

This was solved by changing proxy name (1)

In real account portion (line 29:         // private int _accountID = 102741;)  _accountID is integer, and it gives compilation error(2)

Finally, change of condition to true made code work with real account. Yet, I did not realize it should be false for demo. That is why I told you about it in (3).

And I told you about it as I think it would be beneficial to other traders, who are like me not familiar enough with C# .

 

Thank you

 


@MZen

MZen
17 Jun 2020, 15:28

RE:

PanagiotisCharalampous said:

Hi MZen,

  1. The demo is configured for demo accounts since people use it on demo accounts mostly.
  2. That is not really necessary.
  3. Same as point 1.

Best Regards,

Panagiotis 

Join us on Telegram

1. Gives very funny execution errors and exceptions not directly linked to proxy address. Wouldn't it be better for code to work on real account as well?

2. Gives a compilation error somewhere.

3. Makes real account build unusable. Not everyone has guts to question usability of the sample code. Most people will assume they are wrong. There could be warning about it, at least.

 

Anyway, it is your code.

Best Regards


@MZen

MZen
16 Jun 2020, 17:13

RE:

PanagiotisCharalampous said:

Hi MZen,

I updated the code on GitHub accordingly. You can take the latest version.

Best Regards,

Panagiotis 

Join us on Telegram

Hello,

sorry  to bother you, yet I think there are some inconsistencies in the sample code.

1. Line 28 _apiHost value should be "live.ctraderapi.com"

2. Line 29 _accountID should be long instead of int

3. Line 179  I think works better if we change it to           if (account.IsLive)

Let me know what you think,

Thank you


@MZen

MZen
16 Jun 2020, 17:02

RE:

PanagiotisCharalampous said:

Hi MZen,

I cound not reproduce such a problem. Do you have any specific steps to reproduce this?

Best Regards,

Panagiotis 

Join us on Telegram

 

I could get this error because I opened 'Open API 2.0 Sample' directory located inside of 'Open API 2.0 Sample' directory with different project file Open API 2.0 Sample.csproj instead of Open API 2.0 WinForms Sample.csproj  Actually Main.cs files in those directories have different length.

Could those projects interfere with each other while  opened  simultaneously or  otherwise? This could be the only cause I can think of.

For now I deleted second project Open API 2.0 Sample.csproj with its directory and WinForms Sample still works fine.

So, do we need second project and what is its purpose?


@MZen