Topics
06 Dec 2016, 16:57
 2918
 3
06 Jul 2016, 16:35
 2914
 5
28 Jun 2016, 03:14
 1957
 1
28 Jun 2016, 02:59
 3696
 5
27 Jun 2016, 13:31
 3129
 3
19 Jun 2016, 21:08
 3123
 3
14 Jun 2016, 14:49
 10831
 25
04 Jun 2016, 16:33
 3406
 4
30 May 2016, 01:55
 4057
 5
23 Mar 2016, 22:08
 2857
 3
14 Dec 2015, 18:01
 2596
 2
15 Sep 2015, 00:42
 5315
 9
13 Sep 2015, 02:05
 4016
 12
12 Sep 2015, 14:44
 3889
 5
Replies

moneybiz
18 Jun 2016, 13:08

I had the same problem with my laptop and Windows 10.
I don't know how it exactly disappeared bu I remember it was mismatch of .NET versions installed and the version cAlgo/cTrader was using.
Enable the Windows Updates maybe there is some fix for such mismatch.
Try to install .Net 3.5, 4 (if possible).
Otherwise reinstall the Windows 10.


@moneybiz

moneybiz
17 Jun 2016, 01:04

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

tmc. said:

Obviously base currency. For USDCAD it's USD, for EURUSD it's EUR. Commissions shown are in account currency USD.

If for EUR/USD; 100k trades are in EUR then for each 100.000 EUR you'll pay 0.30 USD one way and 0.60 USD both ways.
If it's 100k trades of USD you'll pay 3.0 USD x 1.1233 = 3.37 USD one way and 6.74 USD both ways as it is indicated on the screenshot.
So 100k trades mean USD not EUR. Look at the volume column it will be EUR 100.000 which is 112.330 USD. That's why you're paying more commission because you're trading more USD than 100.000.

Part of this post was removed by moderator due to a violation of the EULA. Broker discussions are prohibited in cTDN.

 

 


@moneybiz

moneybiz
16 Jun 2016, 23:28 ( Updated at: 21 Dec 2023, 09:20 )

RE: RE: RE: RE:

tmc. said:

moneybiz said:

How did you get that it's USD 100k but not EUR 100k?

So, for USD/CAD 100k traded is what USD or CAD?
For EUR/USD 100k traded is what EUR or USD?

Part of this post was removed by moderator due to a violation of the EULA. Broker discussions are prohibited in cTDN.

 


@moneybiz

moneybiz
16 Jun 2016, 20:47

RE: RE:

tmc. said:

It's commission of $3.00 per $100k traded (per side).

Let's assume your account currency is USD and current rate of EURUSD is 1.2500. If you trade 100k volume on EURUSD you are actually trading €100k as it's based currency of the pair. Therefore, calculation is following:

  • $3.00 * 1.2500 = $3.75 per side

If you account currency was EUR:

  • $3.00 * 1 = €3.00 = $3.75 per side

The hint is unit of trade. How did you get that it's USD 100k but not EUR 100k? You're assuming it's USD and doing the calculation.

The wording must be like this: Commission per 1 LOT (100,000 base currency).
If they say 1 Lot then I know that for every 100k EUR (base currency) I'm going to pay 3.00 USD or equivalent EUR commision (2.40 EUR in your case).

 

 


@moneybiz

moneybiz
16 Jun 2016, 17:18

RE: RE:

So the 100k traded expression is not clear to me. The whole trick is there. They indicate 3.5 USD but they don't indicate what unit is 100k traded. If they say 3.5 USD for Lot then from the definition of Lot it will mean 100.000 EUR (base currency) and item b applies. They don't say anything specific just 100k traded. Go figure.

Ops, 3.5 USD will be 3.0 USD.


@moneybiz

moneybiz
16 Jun 2016, 17:16

RE:

tmc. said:

Actually multiple brokers have stated commission in USD but cTrader platform applies EUR. Could it be platform related?

Spotware, please take a look into this matter.

Back to basics:

1 Lot = 100.000 units of Base Currency

So for EUR/USD;
EUR is Base Currency
USD is Counter Currency

With that in mind 1 Lot is 100.000 EUR.
So when you buy 100.000 EUR (1 Lot)  you sell 100.000 x 1.1209 = 112.090 USD
 

The broker says: Commission of $3.00 per 100k traded.
100k traded what? Apples, cherries, EUR, USD?

a) If 100k traded is USD:
For 100.000 USD traded they charge 3.0 USD, for 112.090 USD traded they charge: 112.090 USD/100.000 USD x 3.0 USD = 3.3627 USD.
From the current exchange rate 3.3627 USD / 1.1209 = 3.0 EUR for 100k traded USD.

b) If 100k traded is EUR:
For 100.000 EUR traded they charge 3.0 USD.
From the current exchange rate 3.0 USD / 1.1209 = 2.6764 EUR for 100k traded EUR.

So the 100k traded expression is not clear to me. The whole trick is there. They indicate 3.5 USD but they don't indicate what unit is 100k traded. If they say 3.5 USD for Lot then from the definition of Lot it will mean 100.000 EUR (base currency) and item b applies. They don't say anything specific just 100k traded. Go figure.


@moneybiz

moneybiz
16 Jun 2016, 14:20

The problem is the general notation of brokers for commission, which is: We charge 3.0 USD per lot per side.
But the calculations treat that USD as account currency not USD really. If your account currency is EUR they treat it as 3.0 EUR per lor per side.

Example:
Account currency: USD
Instrument: EUR/USD
Trade volume: 10.000 shares OR 0.1 lot
Current exchange rate: 1.1209

So the commission must be 3.0 USD x 0.1 = 0.30 USD per side.
But it is 0.30 USD x 1.1209 = 0.33627 ~ 0.34 USD per side. Why? The commision rate is in USD not EUR. Why suddenly start to treat it as it was EUR?

If the account currency was EUR then;
0.30 USD per side means 0.30 / 1.1209 = 0.2676 EUR per side.
But the calculations are vice versa.
0.30 EUR commision per side for EUR account and
0.34 USD commision per side for USD account.

Do I understand it wrong?
 


@moneybiz

moneybiz
16 Jun 2016, 13:12

Wait I may be wrong.
I checked the broker's web site just now and saw that there are 2 prices for different platforms. 3.5 USD/Lot is for MetaTrader and 3.0 USD/Lot is for cTrader.

When it's 3.0 USD/Lot the calculations seem to hold. But I still think there must be extra steps like which direction the position is opened. That way you'll determine to include Ask or Bid side when converting.
I'll make some calculations and write the final decision. :)


@moneybiz

moneybiz
16 Jun 2016, 12:53

RE:

tmc. said:

The method works fine for me.

using System;
using cAlgo.API;
using cAlgo.API.Internals;

namespace cAlgo
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class CommissionCalculator : Robot
    {
        [Parameter(DefaultValue = 30)]
        public double CommissionPerMillion { get; set; }

        protected override void OnStart()
        {
            Positions.Opened += OnPositionsOpened;
        }

        private void OnPositionsOpened(PositionOpenedEventArgs obj)
        {
            double commissions = CommissionPerMillion / 1000000 * obj.Position.Volume / AccountCurrencyExchangeRate() * -2;
            Print("Calculated: " + Math.Round(commissions, 2));
            Print("Actual: " + (obj.Position.Commissions * 2));
        }

        private double AccountCurrencyExchangeRate()
        {
            string accountCurrency = Account.Currency;
            string tradedCurrency = Symbol.Code.Substring(0, 3);

            if (accountCurrency == tradedCurrency)
            {
                return 1;
            }
            else
            {
                Symbol symbol = MarketData.GetSymbol(accountCurrency + tradedCurrency);
                if (symbol != null)
                {
                    return symbol.Bid;
                }
                else
                {
                    symbol = MarketData.GetSymbol(tradedCurrency + accountCurrency);
                    return 1 / symbol.Bid;
                }
            }
        }
    }
}

 

16/06/2016 12:50:58.112 | cBot "Commision" was started successfully for EURUSD, h1.
16/06/2016 12:52:37.533 | Calculated: -0.77
16/06/2016 12:52:37.533 | Actual: -0.66

 


@moneybiz

moneybiz
16 Jun 2016, 01:25

RE:

tmc. said:

Lets say broker charges a commission fee of $45 USD per million traded. If your account is denominated in a currency other than USD you will need to convert this figure.

The calculation is performed as follows:

Commission Each Side = (trade size * $45 per million traded) * account currency exchange rate

Example:

  • Trading 100,000 GBP/JPY with an account currency in EURO
  • 0.000045 * 100,000= £4.50 (Base currency of the pair traded)
  • To convert to Eur we must divide by the EUR/GBP rate
  • EUR/GBP= 0.798
  • Commission each way= €5.63

This will be charged when you enter and when you close the trade.

 

Part of this post was removed by moderator due to a violation of the EULA. Broker discussions are prohibited in cTDN.

Yes but cAlgo doesn't obey this calculation method. Use the numbers I have above, they don't match.


@moneybiz

moneybiz
16 Jun 2016, 01:18

By advising to ask the broker do you mean that for the total lots traded the commissions (not swap) may go lower or there is no standard calculation each broker calculates it however it wants?


@moneybiz

moneybiz
15 Jun 2016, 17:29

RE:

Spotware said:

Dear Trader,

We kindly ask you to contact your Broker regarding this.

If you use Spotware demo, we would like to inform you that it's just for demonstration purposes.

Why should I connect the broker? They say they charge 3.5 USD per lot per side for EUR/USD.
I don't think it's broker related. Why do you think it's broker related?

Whats I'm asking is with the givens how does the value that I see in positions or history is calculated.
The value changes is not constant as stated, which means the current price is included in the calculation. I want to know how. Isn't there any formulation for this?


@moneybiz

moneybiz
15 Jun 2016, 12:16

RE: RE:

chkmitnb said:

Spotware said:

Dear Trader,

Please have a look at the examples of the Last() Method.

Dear Spotware

      The Last() Method, I think the answer not complete . I would like compare between the open price bar No.1 and  Trend line as same period time bar No.1 by  the cAlgo. The Last() Method, The cAlgo can get the open price of bar No.1. But I not sure it can get the trendline price as same period time of Bar No.1. If the cAlgo can get the price each period time by the Last() Method , please show me the example.

Something like this:

var openUnder = trenLineDataSeries.Last(0) < MarketSeries.Open.Last(0);
OR
var openUnder = trenLineDataSeries[index] < MarketSeries.Open[index];

 


@moneybiz

moneybiz
14 Jun 2016, 15:54

RE:

evo8fx said:

Hi All,

I have a cBot I'm working on that runs fine until I start another instance on a different currency pair in the same account.

The position labels are different so I'm not sure what I have overlooked.  If anyone has been through this before I would greatly appreciate your thoughts on this.

Thank you!

Seems like you're not accessing the related instance's market data correctly. Because index value of the price you want to get is not valid. Maybe you're using more than one symbol data and while the index is valid on one symbol it's not valid index for the other...

Put some code to tell more. :)


@moneybiz

moneybiz
11 Jun 2016, 13:09

RE: RE: RE: RE: RE:

zelenij.krokodil said:

Yes, yes, I understand why it's happening!  And no, there is nothing in any log, because I can't get to that stage - in cTrader the algo isn't even listed.  And in cAlgo it's disabled, so I can't run it.  That's why I call it a bug in cTrader/cAlgo - a bug in the GUI.  I think cTrader should not hide those algos that produced an exception on initialization, but should list them in red colour with an error message.

Not listing it or disabling it is a sign of something not right on the initialization part of the bot namely parameters. Which seems enough indication to make you check the code.
But you want it to tell you exactly which part caused the error. Simply you want them to do your job for you.
Probably those attributes are processed on non UI thread and only after proper initialization of the bot each bot is assigned a log window until then it is not possible to display a visual error message.
Actually it is not a bug it is by design that way. Only it could be more informative.


@moneybiz

moneybiz
11 Jun 2016, 02:59

RE: RE: RE:

zelenij.krokodil said:

moneybiz said:

zelenij.krokodil said:

I had this error in my algo code:

 

        [Parameter(DefaultValue = "SomeValue")]
        public double MySetting{ get; set; }


 

So the property type (double) doesn't really match the default value (string).  This thing compiles successfully, but then cTrader doesn't list it under cBots.  cAlgo does list it, but doesn't allow to run it.  I get that my parameter declaration is not valid, and there is probably an exception being thrown in the bowls of cTrader/cAlgo - but some sort of feedback from the GUI would be nice for this and other errors like that.  I do compile my algo from Visual Studio, not cAlgo, if that matters.  The best option would be to list the algo, but show it red with tooltip giving more information...

 

It's not bug of cAlgo it's your mistake to assign string to a numerical value.

I hope you don't also blame cAlgo when your bot doesn't perform well. :)
 

I think you misunderstood me.  My code is wrong, no argument.  The bug in cAlgo is not that it won't allow me to run the robot, but that it won't give me the proper feedback that there is something wrong, and what exactly is wrong!  And it is important in this and similar case, because the code compiles.  It took me awhile to figure out what was wrong.

It compiles because DefaultValue is of object data type. You can put any data type you want. So it won't complain.
But on runtime it has to fire some exception, did you check the log tab, maybe there is some error info?
 


@moneybiz

moneybiz
10 Jun 2016, 20:30

RE:

zelenij.krokodil said:

I had this error in my algo code:

 

        [Parameter(DefaultValue = "SomeValue")]
        public double MySetting{ get; set; }


 

So the property type (double) doesn't really match the default value (string).  This thing compiles successfully, but then cTrader doesn't list it under cBots.  cAlgo does list it, but doesn't allow to run it.  I get that my parameter declaration is not valid, and there is probably an exception being thrown in the bowls of cTrader/cAlgo - but some sort of feedback from the GUI would be nice for this and other errors like that.  I do compile my algo from Visual Studio, not cAlgo, if that matters.  The best option would be to list the algo, but show it red with tooltip giving more information...

 

It's not bug of cAlgo it's your mistake to assign string to a numerical value.

I hope you don't also blame cAlgo when your bot doesn't perform well. :)
 


@moneybiz

moneybiz
06 Jun 2016, 10:29

RE: Swap information

kricka said:

That is a very interesting question you put forward to the Spotware team to answer to.

To my knowledge it can only be retrieved when the swap is an actuality in a position and is debited on the position. The rate question beforehand would be a big help but I don't think that it's a possibility in the current API.

Market Order 3.0 uses the swap information to give the right correct risk at hand though, but to know the swap beforehand, I would like that too.

There is no OnSwapDeducted event on bots API, how is it updated internally?
Do they sync all of the positions with the server periodically? If I have 100 positions opened at the time do they download all positons state from server or just the swap info is comming for each position if so why there is no event to be notified about it?

In connect API I didn't see any info on how to do it. The only thing that can be done is to periodically fetch all of the positions from the server and upadte the local state.


 


@moneybiz

moneybiz
03 Jun 2016, 21:44

RE:

Spotware said:

Dear Trader,

As you most probably already know, when cTrader connects to the cServer, it receives all values of your trading account. A certain period of time of some milliseconds is necessary for the platforms to communicate and exchange the details of a user's trading account. We recommend you to add a delay of some milliseconds to your code, as a work around of your issue. Nevertheless, we understand your complaint and we will take it into consideration four our future plans. 

 

This is serious issue. Anybody who uses some percentage of the equity to open a position is at risk.
I just noticed that today it happened 7 times to me.

If cTrader receives all the values of the trading acount how come the balance comes earlier and sets it equal to equity without receiving the position values.
You should not let the bots run until all the information is in sync.


@moneybiz

moneybiz
30 May 2016, 17:18

RE:

Spotware said:

Dear Trader,

Could you please tell us if you still have this issue?

In addition, by just right clicking on the chart and selecting the refresh field, the historical data will be downloaded again.

The broblem is gone by itself. I didn't do anything after my message and later after hours when I looked the problem was gone.


@moneybiz