Topics
Replies
ctid1980098
24 Feb 2023, 16:16
RE: RE: RE:
ctid5696420 said:
ctid1980098 said:
Hi Dennis,
I have never used "Open API" and can only speak to "FIX API".
I currently have connections to 16 broker accounts via FIX api and the execution is pretty much seamless across all. I am able to buy and sell across all brokers pretty much at the same time. I have never experienced an issue where I have vastly different execution times across brokers, provided you have a vps.... to reduce latency.
FIX took me a while to code up and get into the hang of things, but once up and running the system works flawlessly. My client was happy to copy trades across multiple platforms with FIX platform we designed.
Hi lahsihv,
Hope you are dong good.
I have some questions regarding the fix API ,It would be great if you please help me n this regards . Thanks in advance.
1. Can we copy Trade from one account to multiple accounts using Fix API ?
2. Can we make account linking ? if yes then is limit on account linking ?
3. we have to give minimum 1000 milliseconds delay while switching accounts for copy trading else trade is not being copied ,is there any why out of this ?below is example code for last question.
foreach (var listacc in result)
{
listacc._tradeInitiator.Start();
Thread.Sleep(milliseconds);
listacc._tradeApp.SendMessage(message);
listacc._tradeApp.Dispose();
listacc._tradeInitiator.Stop();
}
Hi Dennis,
Sure I will try to explain on what you have asked.
1. I'm not sure exactly what you mean by copy trade. But with FIX api we were able to code a platform to connect to 16 brokers for our client. So the client can control buying and selling along with stop losses across all these brokers. Our client can select to buy x amount of lots and press the buy button and it will almost at the same time (give a take a few milliseconds) buy those x lots across all the brokers and subsequently manage those positions with stop losses etc. But all this logic must be programmed into the fix app.
2. Not sure what you mean by account linking. But I can connect as many accounts as we need. Currently my client has 16 broker accounts connected for their trading.
3. there is no account switching for the accounts in FIX api. We can send FIX messages to all brokers connected without any switching.
I am not familiar with the code you posted. I have only worked with FIX api. Also FIX API does not give any data recording account properties. its only intended for trading.
It is designed to be low latency and communicate directly with the server and manage multiple broker connections. Hope this helps
@ctid1980098
ctid1980098
13 Feb 2023, 12:43
RE:
Hi Dennis,
I have never used "Open API" and can only speak to "FIX API".
I currently have connections to 16 broker accounts via FIX api and the execution is pretty much seamless across all. I am able to buy and sell across all brokers pretty much at the same time. I have never experienced an issue where I have vastly different execution times across brokers, provided you have a vps.... to reduce latency.
FIX took me a while to code up and get into the hang of things, but once up and running the system works flawlessly. My client was happy to copy trades across multiple platforms with FIX platform we designed.
@ctid1980098
ctid1980098
02 Feb 2023, 08:03
RE: RE: RE: RE: PanagiotisChar, ctid1980098
wwweeeeee said:
It works!! thank you, it works with heartbeat now.
One more thing I want to ask. I have read in the documentation that if HeartBtInt is set to 0, no heartbeat message is required.
So maybe it's was the better idea? Just to set 108=0 and remove the heartbeat. How important is that heartbeat in general?
You're welcome. Glad it worked.
During periods of inactivity, FIX clients should generate a heartbeat message at regular time intervals. The Heartbeat (0) message is used by a FIX client to monitor the status of the communication link.
That is correct. If you set heartbeat to 0 in the login, the server will not send a heartbeat periodically. Better? Not sure on your use case. The reason for the heartbeat is to check if you are connected to the server and you have not lost connection. So pretty important. I set my heartbeat to 5 seconds and respond accordingly every 5 seconds from my application. If there is a break in connection then I will know to reset my socket connection and connect again. So the heartbeat is important to determine drops in connection to server so that a corrective course of action can be implemented. hope that helps. Without a heartbeat it might take longer to determine if something has gone wrong.
@ctid1980098
ctid1980098
01 Feb 2023, 10:02
( Updated at: 01 Feb 2023, 14:42 )
RE: RE: PanagiotisChar, ctid1980098
hi,
Cannot comment on language specifics.
1. To respond to a heartbeat message you would need to possibly run a loop writing to the socket every 30 seconds or whatever time you have set in the login message. Yes, you would need to send a fix message. See below from the link you posted. The heartbeat message is constructed with a standard header and standard trailer as detailed in document. A typical example message would look something like this:
8=FIX.4.4|9=58|35=0|34=5|49=demo.*******|56=cServer||52=20190605-11:57:29|10=175|
Remember to increment the message sequence number incrementally by 1 and compute the checksum calculation for the field 10 every time you send a message or receive for that matter. The documentation shows you all the fields that go into the standard header and trailer.
2.
from documentation: Forces heartbeat from receiver of request. A response is sent from the receiving system as a Heartbeat message containing the 'TestReqID'.
Normally you would get 112=TEST from server and need to include that in the heartbeat response when you send to server.
As a side note. When reading message. You would need to read the first few bytes to field "9=58" then you know how many bytes will follow after that and can read exactly that amount.
@ctid1980098
ctid1980098
30 Jan 2023, 11:02
RE:
hi wwweeeeee,
I see in your login message you have set the heartbeat to 30 seconds. Are you responding to this heartbeat message every 30 seconds to keep session alive?
You also received a test request. Have you responded to this this?
Also note, I see you selected 4096 bytes to be received. What happens when you have read 4096 bytes. does your software have a loop to continiously read from socket or are you handling this async?
@ctid1980098
ctid1980098
30 Jan 2023, 10:56
( Updated at: 21 Dec 2023, 09:23 )
RE:
Hi,
I was also looking for a solution to this for a client and struggled to achieve this solution with the twisted libraries. Eventually I gave up and decided to write the application from scratch using a synchronous setup finally was able to aggregate brokers tick volume using my own custom methods instead of twisted. Something like below is what i delivered to a client. Also curious to see how this could be done with twisted though. Personally i found working with the twisted libraries difficult and caused many issues that I was unable to solve. Maybe because i'm still a novice coder. :)
@ctid1980098
ctid1980098
28 Nov 2022, 09:45
RE: No Hostname in Fix API Dialog.
Groenewald.a.m said:
Hi there,
I think we are missing each other. The dialog that presents the FIX configuration on the cTrader website does not have the Hostname present, just the IP address. In other words, it looks like follows:
Host name: [there is no text here]
(Current IP address 178.62.53.225 can be changed without notice)
Port: 5211 (SSL), 5201 (Plain text)
And when I paste the IP address into the configuration It does not work. Does that make sense ?
Hi,
Ah, I see. Sorry i did misunderstand.
My hostname is populated in the fix configuration . Maybe try reinstalling ctrader?
@ctid1980098
ctid1980098
26 Nov 2022, 22:19
RE:
Hi,
I am able to successfully connect to skilling demo and live accounts as of yesterday. My configuration settings are as follows:
Host name: h6.p.ctrader.com
(Current IP address 178.62.53.225 can be changed without notice)
Port: 5211 (SSL), 5201 (Plain text)
Password: ***** (a/c ******* password)
SenderCompID: live2.skilling.*******
TargetCompID: cServer
SenderSubID: QUOTE
I am speculating maybe there are issues with the python libraries. Are you able to connect via plain text port instead of ssl?
@ctid1980098
ctid1980098
24 Nov 2022, 07:46
( Updated at: 24 Nov 2022, 07:47 )
RE:
Hi Michael,
I have tried the IP address connection for my pepperstone, icmarkets, fxprimus, and axiory brokers live accounts and I was able to connect successfully without any errors.
Although I am not using the python fix libraries and use my own code. Are you able to connect to demo accounts?
I will try to connect to a live skilling and get back to you soon.
@ctid1980098
ctid1980098
10 Nov 2022, 15:57
( Updated at: 10 Nov 2022, 16:09 )
RE:
futuristly said:
Does FIX API support " Market Range " order ? A Market order with determinate value to avoid excessive slippage ?
For Reference :
Hi futuristly,
I stand to be corrected on this, I do not think it can be currently done with FIX API
@ctid1980098
ctid1980098
10 Nov 2022, 11:26
RE:
vishal.indri said:
Dear Sir/Madam,
Greetings for the day
For the Fix Api connection of C Trader ( As we wish to trade on C trader and have to connect our application with C trader account) we required FIX API documentation of C Trader from where we can get it ??
Hope will get response from your side soon
With Regards
Vishal
Hi Vishal
Not sure if you looking for rules of engagement for FIX engine....see below link
https://help.ctrader.com/fix/specs/cTraderFixApi_v2.18.1.pdf
lots of resources in getting started... https://help.ctrader.com/fix/
Not really sure if this is what you are asking
@ctid1980098
ctid1980098
03 Nov 2022, 10:21
RE:
emahohaz said:
hi, i was studying the Fix Api sample written in C# and i am wondering if anyobody can explain to me how Herbeatmessage and Testrequestmessage function works.I mean i understood what type of logic this function calls but not the real essence of them. How can i deploy them in order to get a continuos connection with my broker's server?
Hi emahohaz
I've just barely written my first FIX application so my answer may not be totally correct. Anyway this is what i use heartbeat messages for.
When logging into a price or trade stream I set my heartbeat to 30 seconds. This will send a heartbeat message every 30 seconds from server to me.
The reason i set this is to make sure I have a connection to the server. So on my client application i check to see if a heartbeat message has been received every 30 seconds.
If not, then i initiate a closing of the connection and attempt to reconnect to the server again. You can set the heartbeat time to even lower and continously check on your application if these messages are being received.
Note that you should respond to the heartbeat message when received as well.
Hope this helps
@ctid1980098
ctid1980098
31 Mar 2022, 14:40
RE: RE: RE: RE: RE: RE:
amusleh said:
ctid1980098 said:
amusleh said:
ctid1980098 said:
Ctrader updated yesterday and this no longer works for some reason. Any thoughts? Trying to get it working.
If i get it to work. I will post here
Hi,
I just tested it on cTrader 4.2 Spotware beta and it works fine, on which version it's not working?
Hi,
Tried on 4.2 beta and couldn't get it to work. However my broker still uses 4.1, so i reinstalled and it is working for now. Will try again later with 4.2 beta.
Hi,
If there is any error please post, it works fine on 4.2 and 4.1.
Hi,
Will do. Thank you
@ctid1980098
ctid1980098
31 Mar 2022, 13:55
RE: RE: RE: RE:
amusleh said:
ctid1980098 said:
Ctrader updated yesterday and this no longer works for some reason. Any thoughts? Trying to get it working.
If i get it to work. I will post here
Hi,
I just tested it on cTrader 4.2 Spotware beta and it works fine, on which version it's not working?
Hi,
Tried on 4.2 beta and couldn't get it to work. However my broker still uses 4.1, so i reinstalled and it is working for now. Will try again later with 4.2 beta.
@ctid1980098
ctid1980098
31 Mar 2022, 00:36
RE: RE:
Ctrader updated yesterday and this no longer works for some reason. Any thoughts? Trying to get it working.
If i get it to work. I will post here
@ctid1980098
ctid1980098
04 Feb 2022, 10:47
RE:
amusleh said:
Hi,
The Chart FindObject method returns a ChartObject which is the base class of all other chart objects.
ChartObject class has no y value property, you should cast it to ChartHorizontalLine class, ex:
using cAlgo.API; namespace cAlgo { [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] public class NewIndicator : Indicator { protected override void Initialize() { // The line is a ChartHorizontalLine object var line = Chart.DrawHorizontalLine("myLine", Bars.LowPrices[Chart.LastVisibleBarIndex], Color.Red); // Now to get the line back var myLine = Chart.FindObject("myLine") as ChartHorizontalLine; if (myLine != null) { var yValue = myLine.Y; Print(yValue); } } public override void Calculate(int index) { } } }
Hi amusleh
Ah, I understand now. I was not aware of that you could cast to a class ChartHorizontalLine. Appreciate your assistance. Thank you
@ctid1980098
ctid1980098
08 Mar 2023, 12:46
RE: RE: RE:
heinrich.munz said:
Hi heinrich.munz
Notice i said 16 broker accounts and not 16 brokers.
Here is a link to cTrader featured brokers. In total i think its 8 icmarket accounts, 5 pepperstone account, 2 skilling accounts and 1 trade view markets account giving a total of 16 accounts. They all support fix.
@ctid1980098