Topics
06 Dec 2016, 16:57
 2673
 3
06 Jul 2016, 16:35
 2631
 5
28 Jun 2016, 03:14
 1775
 1
28 Jun 2016, 02:59
 3480
 5
27 Jun 2016, 13:31
 2888
 3
19 Jun 2016, 21:08
 2917
 3
14 Jun 2016, 14:49
 10362
 25
04 Jun 2016, 16:33
 3139
 4
30 May 2016, 01:55
 3801
 5
23 Mar 2016, 22:08
 2626
 3
14 Dec 2015, 18:01
 2423
 2
15 Sep 2015, 00:42
 5061
 9
13 Sep 2015, 02:05
 3775
 12
12 Sep 2015, 14:44
 3672
 5
Replies

moneybiz
19 Jan 2017, 13:02

RE:

Spotware said:

All server are connected to real price feeds via FIX API, Spotware also manages those integrations directly with the technology provider who supports them.

It would be impossible for a broker to compromise cServer.

cServer <- Manipulated Price Feeds Server <- LP Price Feeds Server
So you're claiming that there is no possibility for a server in the middle between cServer and liquidity provider's price feeds, because you directly manage this integration?


@moneybiz

moneybiz
13 Jan 2017, 14:47

I raised that question before and coldn't get a satisfactory answer.
After some research I found out that there are brokers with "Last Look" and without "Last Look" operations.
"Last Look" simply enables market makers to delay or reject trades from customers after they’ve agreed to a quoted price. This is something that brokers may abuse for their advantage!
I think the significant delay could be from that.
Brokers are not transparent on that issue and nobody exactly knows what's going on inside.
There are brokers without last look but they don't support cTrader.


@moneybiz

moneybiz
09 Aug 2016, 12:31

RE: RE:

1015060 said:

Dear moneybiz :

thank you for your replying, but I don't think the Symbol is the problem. As you can see I only opened 4 positions in total and they are all the same AUD/CAD pairs.

the problem is how could a third position become the first position?

I saw the 2nd image where there were EURUSD positions, for this I thought that you're not filtering them properly.
Anyway, I didn't test if index matches the entry time of the position but if that's really the case just order the positions by entry time to get what you want:

var positions = Positions.OrderBy(p => p.EntryTime).ToArray();

 


@moneybiz

moneybiz
09 Aug 2016, 00:30

Include also the Symbol of the Positions[index] to see better what you're looking for.
Since you'are not filtering the positions for a specific symbol it's possible that there are positions belonging to other instruments which you are not aware of.


@moneybiz

moneybiz
17 Jul 2016, 23:47

RE:
(double)long_position.StopLoss

StopLoss is nullable double which means it can be null. Correct your logic to handle "double?" data type.


@moneybiz

moneybiz
07 Jul 2016, 18:51

RE: Execution time window

kricka said:

the execution time regardless of which broker is used, lands between 200-300ms. This is a in my opinion a window that the broker needs to be able to operate and maybe hedge the incoming orders. Hopefully this window in ms will be decreased in time by Spotware as their platform technology improves.

The message above yours says the range is around 100-120ms. So it must be broker dependent.
Spotware claims sub-millisecond execution speeds which seems not real.

If broker hedges you then they are playing against you which means they can also do other things to make you lose your money. Leave that a side, they are the server which means they must execute the hedged orders in sub-millisecond level. Do you think it can cause such high execution time?

 

Spotware, can you be more transparent about the execution times of brokers, are they fixed or changing, and what effects the change?


@moneybiz

moneybiz
06 Jul 2016, 15:51

RE: RE: Memory Manager

ChasBrownTH said:

PS - I use your Memory manager BOT and it is excellent !  Thank you for sharing it. ;)

I'm happy that it became a useful tool for the community.

 


@moneybiz

moneybiz
01 Jul 2016, 12:53

RE: RE:

jhonti said:

Thanks for your help, however this seems to give different results to using the market snapshot tool, why is this?

There is also BidEntries like the above AskEntries that you can enumerate.
I never used it so I don't know if they are different or not.
Make sure you're looking at the same instruments when comparing. I mean compare EURUSD and EURUSD. Not EURUSD and GBPUSD.
And make sure the two clients you're comparing are connected to the same broker.


@moneybiz

moneybiz
30 Jun 2016, 21:25

            foreach (var askEntry in MarketData.GetMarketDepth(Symbol).AskEntries)
            {
                Print("Ask Price: {0}; Ask Volume{1}.", askEntry.Price, askEntry.Volume);
            }

 


@moneybiz

moneybiz
29 Jun 2016, 15:04

RE: RE: RE: RE: RE:

smashthosewolverines said:

For real accounts. I just received an email from IC Markets that the fill times would be close to 200ms (to open a position) and another 200ms to close. Almost every broker who uses cServers have execution speed of a couple of hundred ms (which as you can may cause the price to slip). If you are using the function ExecuteMarketOrder, you may have slippage control there where orders will be simply rejected if a particular price is not met.

On hunting for best brokers in terms of deep liquidity, execution speed, I find LMAX's, and FXCM's to be very small - LMAX (3 ms execution) and FXCM (30 ms execution). But none offer cTrader platform - LMAX offers FIX (and the not so good MT4 bridge) and FXCM - MT4. LMAX though is an exchange of its own doesn't have dark liquidity - meaning privileged traders get to access LMAX's order book/D.O.M. 

Yes I'm aware of the marketRange parameter for slippage limitation. I used it.
LMAX have .NET API if you don't want to use FIX. Just ask them with email and they'll send it to you.
cTrader is quite flexible for bot business but not very available like MT4. Maybe because it doesn't allow brokers to manipulate it like MT4. There are lots of rumors going around MT4.
I simply try to stay away from brokers who only provide MT4. There are many talks about MT4 on forums...


@moneybiz

moneybiz
29 Jun 2016, 12:09

RE: RE: RE:

smashthosewolverines said:

Thank you. I also find striking differences between IC Markets - 300-500 ms, Spotware Demo - 200-250 ms, FxPro - 50 ms. I was wondering what changed from now and say a year back when the execution times were close to 10-15 ms. Delaying is a tactic used by brokers and that makes it very unpleasant for scalping.

Are these numbers of demo accounts or real?
I was thinking to rent a dedicated server or VPS with speeding up the execution times in mind but after the numbers you published I see that it won't make any difference.

The latency numbers we see on cTrader/cAlgo don't mean anything at these conditions. It's just makeup of the broker. Look how fast we are but in reality we are not because our real server is at the other end of world and we forward all request coming from you there...
The increased execution time also means more slippage. So if you see 0.3 pip spread in reality due to the slow execution times this value receives let's say 0.8 pip slippage over it and becomes 1.1 pip.
The 0.0 pip spread and fast execution times seem to be just an advertisement, reality is much different.


@moneybiz

moneybiz
29 Jun 2016, 11:59

RE:

lec0456 said:

I am backtesting a cbot and it is extremely slow.  What can I do to figure out why and improve performance?

I think it is normal if your bot works with tick data. It means on every tick received all bot logic is reprocessed. Sometimes there are 5-6 ticks in a second and you bot must be able to process all the 6 ticks in 1 second. If you can't then you're losing the market information.
Better do some benchmarking to see where the code performs poorly. See here.

If you are for example enumerating positions many times to calculate different data try to calculate them inside a single loop. Try to optimize the code.
I also use tick data for botting and yes it's really slow, that's why i test 1 week - 10 days max. It gives me a general idea how the forward performance will be.
There is nothing much to tell than optimize.


@moneybiz

moneybiz
28 Jun 2016, 22:19

RE:

Actually it's quite easy.
You need to subscribe to position opened and position closed events to send your requests to your web api.

Here is the code.

protected override void OnStart()
{
    // Subscribe to events.
    Positions.Opened += OnPositionOpened;
    Positions.Closed += OnPositionClosed;
}

protected override void OnStop()
{
    // Unsubscribe to events.
    Positions.Opened -= OnPositionOpened;
    Positions.Closed -= OnPositionClosed;
}

public void OnPositionOpened(PositionOpenedEventArgs args)
{
    var endpoint = "htpp://api.server.com/positions/add";
    var data = string.Format("pid={0}&ep={1}&et={2}", args.Position.Id, args.Position.EntryPrice, args.Position.EntryTime);

    var response = new WebClient().UploadString(endpoint, data);
}

public void OnPositionClosed(PositionClosedEventArgs args)
{
}

 


@moneybiz

moneybiz
28 Jun 2016, 20:44

RE:

smashthosewolverines said:

Hello,

I see a delay of around 300ms (the RT to the VPS being only 2ms to the server) while the order is filled. Is it because of cTDN delaying the orders or LP or the broker? If the execution is close to 300 ms, what good does it do to have submillisecond proxy?

 

Thanks

My latency is 15/25ms and execution time is around 250ms in demo accounts.
If for 2ms latency you're getting 300ms execution times I start to suspect.

Maybe the brokers have middle servers which receive information and forward it to the real hidden server, thus we see low latency.
Otherwise why is there a huge delay on execution times compared to latency.
Maybe somebody knows something we don't know and they can explain...


@moneybiz

moneybiz
28 Jun 2016, 20:40

RE:

emmamail said:

Hello Support,

 

Please I need a code to start two cbot ,can that be possible ?

 

Emmanuel

There is no code to start 2 bots. But if you have their source code you can combine them under a 3rd bot which will feed the tick data to both of them.
If those 2 bots don't need to communicate with each other you can add 2 instances of the bot and start them manually.


@moneybiz

moneybiz
27 Jun 2016, 15:53

RE:

MaVe said:

Maybe you can use something from this Calculators for your Money Management:

http://www.fxpro.co.uk/trading/calculators/all-in-one

I need real-time calculations. Also when back-testing which is another issue, the exchange rate has to be embedded inside the position info.  


@moneybiz

moneybiz
23 Jun 2016, 23:53

RE:

Spotware said:

Dear Trader,

The first time this method is called it subscribes for prices and returns the symbol only when the prices are received. Any additional request will return current prices, as it's already subscribed.

Thank you.
Seems everything is OK.


@moneybiz

moneybiz
21 Jun 2016, 00:05

Correction:

var expectedPrice = side == TradeType.Buy ? Symbol.Ask : Symbol.Bid;

 


@moneybiz

moneybiz
20 Jun 2016, 20:48

Slippage can be calculated very easily.
Before sending the ExecuteMarketOrder request save the current Bid/Ask depending on the side you trade and if the execution is successful take the difference between the Entry Price and saved price.
 

var side = TradeType.Buy;

var expectedPrice = side ==  TradeType.Buy ? Symbol.Bid : Symbol.Ask
var result = ExecuteMarketOrder(....);

if (result.IsSuccessful)
{
   var slippage = position.EntryPrice - expectedPrice;
   var slippagePips = slippage/Symbol.PipSize;

   if (slippagePips > 0)
   {
      // The price was worse than expected.
   }
}

If you don't want slippage you can use pending orders. Since they are waiting on the server side to be filled they won't suffer from client-server round trip.
If slippage for pending order is not zero and always worse than expected then the broker is probably putting some commissions on the price. :)


@moneybiz

moneybiz
19 Jun 2016, 20:17

RE:

Paul_Hayes said:

Additional Steps to Lower CPU

Some additional steps you can take to lower the CPU usage on the VPS with cTrader is to always minimize the platform application, if you leave the charting window visible, then the CPU will work hard to calculate and draw all the graphics. 

You don't need to minimize actually, just click on the bot name (not the instance), which removes the chart and shows the code window.
It also lowers the CPU usage, you can test this with task manager. When the code window is visible it uses less CPU.

In fact this happens automatically I guess. Because when I connect to my server with Remote Desktop I always see that the chart is not shown but the code window.
I think it's intended to work that way by Spotware. At the beginning it was quite annoying to switch back to chart to see what my bot is doing but then I thought this is exclusively made for that. To not waste resources when not needed.

Also selecting the "High performance" power plan at Power Options may help with CPU and network disconnect issues but I'm not quite confident on this.


@moneybiz