Topics
21 Mar 2017, 07:32
 3388
 4
21 Mar 2017, 07:31
 1874
 2
28 Sep 2016, 22:42
 2554
 2
30 Aug 2016, 03:31
 3205
 3
27 Aug 2013, 21:35
 2940
 2
12 Aug 2013, 16:50
 3724
 4
13 Jun 2013, 20:44
 4382
 2
13 Jun 2013, 19:54
 3175
 3
03 Jun 2013, 20:32
 0
 3693
 8
14 May 2013, 16:26
 2884
 2
Replies

ianj
27 May 2017, 13:38

Its non trivial am afraid

1. FIX is language neutral - you can implement your own models in other languages - e.g. Java/C++/C# - you just need to write or use (far preferable) an existing FIX framework
2. Even if you could write or acquire a FIX library for MQL you would have problems with INDICATORS - the standard MQL indicators/data access assume they have a feed from MT4 and i assume you want the feed from cTrader so they wont work or be correct for the cTrader feed. 3rd party indicator libraries do exists but they produce sligthly different results so settings from an MT4 EA would need retuning
3. The FIX API is not directly compatible with the MQL trading API so you would have to reimplement or bridge your MQL trading logic to the FIX library
4. There is a conversion tool to convert MQL to cTrader C# but this is using the c# library (as a cBot) and does not use FIX. And it only does a partial; jobs, nothing will convert and work out of the box

Basically what you are trying to to is not easy

Port is not the term, Re-implement is

I think spotware's aim is to provide the cBot C# environment for mainstream EA programming and the FIX to interface with 3rd party trading tools

 

I am a developer and have used many (over 10) different FIX connected systems and each is different

In particular the spotware offering has INSUFFICIENT features to be used on its own - you need to use the Connect API to supplement it (Although i would admit that it is getting nearer each month so it looks like we will get there) It is only really useful for limited surgical processes (faster data streaming, fast but limited order placement) 

I could easily list SHOW STOPPERS that would stop it being useful as a SOLE trading interface - there are still quite a few left - you need to check out the FIX API reference from sptware to see what they support at the moment)


@ianj

ianj
21 Mar 2017, 07:28

RE:

And ? Is this now available Live - i haven't seen any notifications in this thread or the forum

 

Spotware said:

We are pleased to announce that we have now supported trading via FIX API with Hedging accounts. So far this is only possible with Demo accounts. You can expect to use Live accounts in ~2 weeks. We will update this thread once it becomes possible. 


@ianj

ianj
02 Oct 2016, 02:50

RE: RE:

As of Sept 28th this is STILL a problem - specifically on the FxPig LIVE SPA feed (and MPA to a lesser degree) 

Here you have a quote being deleted (where there is none on the book) and then re-added (never to be removed)

If you need examples, either in the clear form below or the original FIX, do not hesitate to ask 

I am unable to use the FIX tiered feed live until i get past this as i am unable to analyse the remainder for faults and this is burying any possibility of analysis

The updates are so close together (1 ms) that i would hazard a guess that it is a message ordering problem - are the messages coming from different sources/threads and not being re-integrated correctly?

Please advise

16.09.27 22:00:00.383,pigs,AUDUSD,+761596536:1:0.76685/1000000,+761596535:1:0.76684/2000000,-761596455
16.09.27 22:00:00.384,pigs,AUDUSD,+761596455:1:0.76684/3000000,-761593363,-761594513

 

ianj said:

If you have any difficult replicating the issue, try the fxpig SPA (unfiltered) feed, and also to a MUCH lesser degree the MPA feed. I have not seen the problem on icmarkets or pepperstone so far. 

 


@ianj

ianj
19 Sep 2016, 13:36

RE: RE:

+1 for me as well - both ways please

rmssf said:

Please keep the option open to connect without SSL also.

Thank you.

 


@ianj

ianj
13 Sep 2016, 15:23

RE: RE: RE: RE: RE: RE: RE: RE:

If you use unique MdReqId in each market data subscription and ONLY use 1 Symbol in each subscription the updates should come through in separated messages because there is only 1 MdReqId for each market update message

Other than that it is implementation specific

http://btobits.com/fixopaedia/fixdic44/index.html

 


@ianj

ianj
13 Sep 2016, 13:35

RE: RE: RE: RE: RE: RE:

Price quotes are by default indicative - there is no guarantee that you can execute at that price for any length of time. As long as they don't HAVE to honor the price the prices across multiple symbols do not HAVE to align (though it saves them hassle if they do). Some brokers matching engines are auto-matching so they execute without liquidity supplier intervention - emitting consistent symbol groups prices is then far more important as it requires manual intervention to "break" a trade. 

I rarely see scenarios where repeated quotes are sent just for the sake of it - it adds little information (except perhaps it increases the possibility of executing at the price - the price is less likely to be stale)

The terms i mentioned before are the regular terms used in the industry for these operations: Conflation/Time slicing/Filtering and it is not standardised

rmssf said:

In theory? If you know that there is one "tick" for each symbol and they are generated asynchronously in respect to each other, how would multiple symbol quotes work in a single message? Would the message be delayed while waiting for a quote for all symbols to get stacked, or would it send repeated quotes for all symbols each time a new quote for a particular symbol arrives?

ianj said:

 


@ianj

ianj
13 Sep 2016, 13:11

RE: RE: RE: RE: RE: RE:

If it was not possible (according to the protocol), there would not be a Symbol for EACH price/tier update - there would be a single Symbol for the whole message. The FIX protocol spec does in fact define what it means when the Symbol is absent for each price update - you assume it has not changed since the last price (specifically any non TOP update)

As you suggested "in reality" ticks are usually discrete so the update is pushed out for that symbol only

However, a market making operation would often emit a collection of symbol updates when an underlying currency changes in perceived value - so for example if a lot of GBP was purchased, then there would be affects on GBPUSD, EURGBP, GBPJPY etc and a market maker would/could emit a family of pairs at the same time on the SAME tick (to avoid arbitrage hits) - in theory these could/SHOULD appear in the same message - that is why the FIX protocol allows it

Quotes are delayed and/or reduced (filtered/CONFLATED/time sliced) to offer enhanced value for those who are willing to pay extra and reduce the communication/processing overhead for those unwilling or unable to handle all updates. The brokers also run liquidity aggregation and what and when is emitted is configurable

I am surprised that so many feeds actually are for 1 symbol only

I have an issue with "corruption" on the book on the FIX feed for 1 broker only (FxPig) and it has occurred to be that my own assumption that all updates are for a single Symbol might be the cause - hence my comments here. I will comment again when i have performed some tests over the next day or so 

 

rmssf said:

In theory? If you know that there is one "tick" for each symbol and they are generated asynchronously in respect to each other, how would multiple symbol quotes work in a single message? Would the message be delayed while waiting for a quote for all symbols to get stacked, or would it send repeated quotes for all symbols each time a new quote for a particular symbol arrives?


@ianj

ianj
12 Sep 2016, 18:32

RE: RE: RE: RE:

Yes, In theory you can get a single message with updates for multiple Symbols (hence the spec allowing separate Symbol for each price)

No, in practise i have never seen them mix on the same message - you get a separate message for each symbol

Saying that, i have a current problem with one particular Spotware broker feed - i wonder if this could be happening?

 

rmssf said:

No, you get 2 streams, one message for each symbol and properly identified with the symbol id.

mclskan said:


@ianj

ianj
12 Sep 2016, 10:23

RE: RE:

I haven't noticed 272 but i haven't subscribed over weekend either and  i haven't tried fxpro at all - ill see if i have my FIX logs enabled (I am tracking several cTrader brokers) - maybe its broker specific 

Some brokers have high tick rates on cTrader, others less so - most in excess of any MT4 feed

mclskan said:

rmssf said:

I just tried using your code without any modification, it works fine and still without seeing field 272.

It must be something you have there upstream.

It seems because of weekend I didnt recieve any price data. I recieve it now but the issue is I recieve a lot of bid and ask. It is market depth probably but I didnt want that in the code as I stated.

I dont know which price is real price now.

 


@ianj

ianj
11 Sep 2016, 14:17

RE: RE: RE: RE:

I know its repetition but another view always helps:

http://stackoverflow.com/questions/32708068/how-to-calculate-checksum-in-fix-manually
 

and

Body length

Body length is the character count starting at tag 35 (included) all the way to tag 10 (excluded). SOH delimiters do count in body length.
For Example: (SOH have been replaced by'|')

8=FIX.4.2|9=65|35=A|49=SERVER|56=CLIENT|34=177|52=20090107-18:15:16|98=0|108=30|10=062|
     0   + 0  + 5  +   10    +   10    +  7   +        21          + 5  +  7   +   0    = 65

Has a Body length of 65.
The SOH delimiter at the end of a Tag=Value belongs to the Tag.

Checksum

The checksum algorithm of FIX consists of summing up the decimal value of the ASCII representation all the bytes up to but not including the checksum field (which is last) and return the value modulo 256.


@ianj

ianj
10 Sep 2016, 00:59

RE: RE: RE: Fix SSL

The broker can just play with the messages in the engine if they want to - intercepting FIX is the last thing they would look at. I think in this case the servers are owned by spotware and leased to brokers but am not really sure.

 

The main problem is that the credentials can be captured/intercepted by intermediaries on the public internet - they can then login and do what they like 

 

tetra said:

No SSL certificate provided, without that it is not possible to use secure SSL connection.

 

Without SSL the price can be intercepted and twisted. This gives the possibility for the broker to use a virtual dealer plugin type software.

 


@ianj

ianj
09 Sep 2016, 22:58

RE: RE: RE: RE: RE:

Because the protocol uses sequence numbers and a number of messages to maintain the sequence numbers. If you try and recreate without having the proper knowledge you will waste far more time than getting a proper FIX library to work

They are not so honorous for a PRICE feed where you normally just reset the sequence number but many TRADE feeds are fussier about supporting the proper messages (though spotware seems particularly tolerant) 

The messages field/groups can also be pretty position dependent - if you intend on rolling your own then its better you sample an actually working stream (using a conventional FIX library - lol) and then reproduce it

The only reasonable argument i can imagine for rolling your own parsing is extreme speed/low latency where you implement you own custom parsing suited to the stream. This is, however, a very specialist use case

Good luck 

tetra said:

Tell me more, why can't I just read the socket and parse the messages? It is never too late to learn.

I see somebody already give it a try: /forum/fix-api/10251


@ianj

ianj
09 Sep 2016, 19:06

RE: RE: RE:

Haha - If you don't THINK an external library is necessary, then it is 

The synchchronisation issues alone ensure that 

Any of the quickfix* implementations should work without a problem once you work out the spotware specifics and limitations

tetra said:

I am looking for an example like this: https://github.com/spotware/connect-csharp-samples

I don't think external library is necessary, but if you have an example with that, could you copy paste a kick-start snippet? Login and subscribe quote/depth?

Thanks,

 


@ianj

ianj
09 Sep 2016, 01:52

RE:

No am not trading live with it live yet - i NEED the ability to net the trades without paying extra commissions/spreads - i haven't yet asked for a netted account - i do not know if they are available or not. There is not enough functionality in the FIX interface alone so i am looking at the Connect AP to supplement the functionality (I need modify/list orders, account info etc) 

 

paulmtas said:

 

Hi IanJ,

Thanks for the reply.  Nice to see its working for you.  I'm having to settle on a proxy in Amsterdam for my price feed at the moment.  I was wondering. Are you trading yet? have you figured out how to close trades with message 'D' or do Buys/Sells clear automatically at the end of each day like most institutional accounts?

 

Cheers,

 

Paul

 

 

 

 


@ianj

ianj
08 Sep 2016, 21:33

RE: RE: RE:

I have generally had good connectivity and i have been streaming on the FIX connections from several servers without problems for a week or so, EXCEPT last night - early hour GMT when i was unable to connect to the Think Markets demo feed - on checking the FIX IP had changed, and it seemed to flip back a little later and is working fine now . All other connections seemed fine 

So yes i would guess it varies - but only had a connectivity problem on demo account so far for me

paulmtas said:

Tried again today and noticed I can't get price feed from London servers with message 'V' - get a reject even with my VPS in London.  I am able to get a price feed from servers in Australia where I am just fine.

Checked I have the right ports etc.

I wonder if any one else is having issues with this? 

 

paulmtas said:


@ianj

ianj
01 Sep 2016, 21:00

RE: Fix SSL

You got a good point there about SSL - the only time i have ever seen a non SSL connection is within a data centre where the endpoints are physically known and the routing is dedicated or at least private 

Am sure you can find a FIX engine in C#

Try looking here https://en.wikipedia.org/wiki/QuickFIX

 

mindbreaker said:

Thanks

I need example with C# and SSL (Financial app whitout ssl its stupid).

I don't like Java and Android but:

You can show example.

Nice day

 


@ianj

ianj
01 Sep 2016, 19:40

Try without SSL - i am using quickfixJ without SSL and it "works" fine (with caveats)


@ianj

ianj
01 Sep 2016, 17:12

RE:

Just to confirm, a position reversal works in a netted account and reduces the margin accordingly, unlike a hedged account where the margin on the 1st position is still used until both are closed (with additional commission as i suggested) 

So, with a NETTED account, and given that you cannot specify stop loss or take profit then the remaining major omission is STOP entry orders (since you already support LIMIT entry orders)

I am guessing that the FIX capability was provided to cover only the most performance related operations ? (ie prices and basic orders)

A cancel/close that works appropriated with a HEDGED account is still a requirement, imho

Spotware said:

Dear Traders, 

Please be advised that in order to close order, you need to open the single order for the same symbol but with the opposite direction.  If you want to close the Buy order, you need to open the Sell order and vice versa.    

 


@ianj

ianj
01 Sep 2016, 14:54

RE:

As others have said this is not viable in a hedged account as it still consumes margin for the initial position until you close both positions - how does that work with commission ?

Spotware said:

Dear Traders, 

Please be advised that in order to close order, you need to open the single order for the same symbol but with the opposite direction.  If you want to close the Buy order, you need to open the Sell order and vice versa.    

 


@ianj

ianj
30 Aug 2016, 21:33

RE:

It would appear that the FIX standard is not flexible enough to support that - lol

/forum/fix-api/10233

I tried a few variations using any label/combinantion of Cl/Orig orders etc - the message was just ignored so we can probably assume there is no implementation behind the message

ctid212194 said:

Hi,

   Is there a way to close an order using FIX 4.4? 

   I have been able to connect to the cServer, receive Market Data and execute Market Orders, but I didn't see any message in the document cTrader FIX Engine, Rules of Engagement Spotware Systems Ltd Version 2.5, 2016-06 that seemed like it would close an existing order. 

Thanks,

Justin

 


@ianj