SH
Shares4UsDevelopment
1 follower(s) 1 following 111 subscription(s)
Topics
04 Apr 2024, 15:24
 2
 550
 4
19 Dec 2023, 10:33
 2
 521
 0
15 Dec 2023, 08:08
 1
 530
 0
14 Dec 2023, 08:45
 1
 572
 0
14 Dec 2023, 08:34
 1
 468
 0
08 Dec 2023, 15:52
 0
 511
 0
03 Mar 2023, 17:10
 3
 1342
 4
Replies

Shares4UsDevelopment
17 Mar 2020, 10:24

RE:

PanagiotisCharalampous said:

Hi Shares4UsDevelopment,

Price feed issues should be attended by the broker. Please contact your broker regarding this.

Best Regards,

Panagiotis 

Join us on Telegram

Hi Panagiotis,

Thanks for your standard reply on pricefeed issues.

But this happens on pricefeeds on SPOTWARE and other brokers.
As the common denominator is cTrader, I guess it's not a brokers pricefeed problem.
Best rgds,

 


@Shares4UsDevelopment

Shares4UsDevelopment
26 Feb 2020, 09:42

RE:

 

We report to you that the Stop Loss has not been set. Any further decisions are trading decisions and it is not the job of the API to take trading decisions on behalf of the trader. This task should be a responsibility of the strategy/cBot. After all the cBot is a "contractor" itself. 

 

As I said: We differ!
I know I can check and have to act accordingly,
But you're missing the point.
You are NOT notifying the client. The client has to check if you did your job 100%.
Throwing an errormessage would be notifying.
And furthermore: Only doing half the job without notifying is i.m.o. bad service.

Best rgds,

A.R.
 

 


@Shares4UsDevelopment

Shares4UsDevelopment
26 Feb 2020, 08:07

RE:

you can find a lot of martingale robots for free on this forum. they will do what you want


@Shares4UsDevelopment

Shares4UsDevelopment
26 Feb 2020, 08:03

Nice message but:
What is the bot and what are the errors?


@Shares4UsDevelopment

Shares4UsDevelopment
26 Feb 2020, 07:59

RE:

Dear Panagiotis

There we differ.
I think that if a program tells your system to execute something it should either do it or give an error
message or,  when it is a multi step execution, try to rollback and give an error message, or fix the damage
in the best possible way and notify the principal/client/

It is the responsibility of the contractor/receiver to execute or to say it can't.

That's the way 99.9% of all the things work in programming.

I've done some forum research here but this is an issue that already exists for a longer period.

Would be nice if you guys could solve it.

Otherwise a connection failure, power outage or computer restart might leave a cTrader user unprotected.
And that's not what we want , do we?

Best rgds,
A.R.


@Shares4UsDevelopment

Shares4UsDevelopment
25 Feb 2020, 12:53

RE: RE: RE: Saving optimisation results

victor.major said:

SwXavi said:

phill.beaney said:

I don't understand why more people aren't requesting this, unless there is a way to save the data from a temp file that everyone except me is ware of.

Any Ideas welcome.

I really like this to be implemented in order to do proper research, currently backtests and optimizations cannot be shared or exported, the only option is to do screenshots, which is awful.

Seconded and thirded +1... I now see that I was not mistaken and that there is in fact no way to export/save/restore optimisation data. I find this so unusual that I am still not convinced that I am not missing something. I am not aware of any other modeling or simulation software that does not save the simulation results, ie. I am not comparing cTrader to MetaTrader. There is a basic expectation that if you spend one day on generating simulation results that you will be able to work with them after the fact, or that they will be saved somewhere in case there is a software problem or a crash - which is what happened to me just then.

Just write your own GetFitness function and dump the results in a csv or tsv or whatever file you want.


@Shares4UsDevelopment

Shares4UsDevelopment
21 Feb 2020, 18:10

RE:

srubtsov said:

Also possible to use method to get only symbol settings without any "live" data

var symbolInfo = Symbols.GetSymbolInfo("AUDDKK.spa");
if (symbolInfo != null)
    Print(string.Format("{0}, PipValue: {1}", symbolInfo.Name, symbolInfo.PipValue.ToString("F" + symbolInfo.Digits)));

I know, but that's not what i mean! 
the problem is 'not throwing an exception'  which is more fitting to the way cTrader automate works than a log entry.


@Shares4UsDevelopment

Shares4UsDevelopment
20 Feb 2020, 13:01

RE:

mr.hichem+ctrader1 said:

You can test if the symbol exist: thisAlgo.Symbols.Exists(SymName);

Thanks for thinking with me.

But the problem is 'not throwing an exception'  which is more fitting to the way cTrader automate works than a log entry.

Also you solution will not always work. If the symbol is there but has no data the log still gets filled.:-(
Check the little test down here:

protected override void OnStart()
{
    Print("Loading " + Symbols.Count);
    foreach (string Pair in Symbols)
    {
        try
        {
            if (Symbols.Exists(Pair))
            {
                Symbol symbol = Symbols.GetSymbol(Pair);
                if (symbol != null)
                    Print(Pair , "  ", symbol.PipValue);
            }
        }
        catch(Exception ex)
        {
            Print(Pair , "  ", ex.Message);
        }
    }
}

that wil give the following output:
 

20/02/2020 10:54:29.177 | cBot "New cBot" was started successfully for EURUSD.spa, h1.
20/02/2020 10:54:29.177 | Loading 67
20/02/2020 10:54:29.192 | AUDCAD.spa  0.754068 0.754068 40000
20/02/2020 10:54:29.661 | AUDCHF.spa  1.017139 1.017139 40000
20/02/2020 10:54:33.083 | Failed to get symbol 'AUDDKK.spa': symbol has no quotes.
20/02/2020 10:54:33.208 | AUDJPY.spa  0.008916 0.008916 40000
20/02/2020 10:54:33.411 | AUDNZD.spa  0.633590 0.633590 40000
20/02/2020 10:54:33.427 | cBot "New cBot" was stopped for EURUSD.spa, h1.

So I'm still in developer-Darkness

 


@Shares4UsDevelopment

Shares4UsDevelopment
19 Feb 2020, 11:45

RE:

evb.family said:

Can you please add Heiken Ashi Chart to cTrader Desktop? Thank you

What's wrong with the existing Heiken ashi ??


@Shares4UsDevelopment

Shares4UsDevelopment
19 Feb 2020, 11:41

RE:

1064778 said:

please make that all new drawings (trendlines) are replicated to all charts in the layout and shown when the same ticker is selected !!..

You ALREADY posted this suggestion.
Not Upvotes and views are lower per item than it would have been had you not posted twice.
I guess this is not the way should draw attention to your idea.


@Shares4UsDevelopment

Shares4UsDevelopment
19 Feb 2020, 11:35

RE:

On what basis should the open and close be set ???


@Shares4UsDevelopment

Shares4UsDevelopment
17 Feb 2020, 13:52

RE: RE:

Thanks for thinking with me, but I should elaborate a little more on the problem I guess,

The problem is obtaining the tick time which is not a property of  SymbolTickEventArgs.


@Shares4UsDevelopment

Shares4UsDevelopment
14 Jan 2020, 10:41

RE:

Sorry can't reproduce it was only once and Restarting fixed it.
If it happens again i'll notify here

 

 


@Shares4UsDevelopment

Shares4UsDevelopment
09 Dec 2019, 19:30

RE:

Hi Panagiotis,

Wow that's a bugger.

So actually it is impossible to do secure and proper riskmanagement in optimization. 
That makes multi-symbol optimization not very useful if you can't manage the risks.


I hope you will give this a bit of priority. (for the sake of the financial well-being of your users.)

Best rgds,

Ton

 


@Shares4UsDevelopment

Shares4UsDevelopment
09 Dec 2019, 13:24

RE:

Hmmppf,

That's a dissapointment Panagiotis. Do you have any idea when it will be?
And .....
-any idea how to calculate the risk taken before taking a position in a Pair not equal to the account currency without using the symbol Class?
EG: Risk in USD when taking 1lot in NOKJPY with a 10 pips SL??

 

 


@Shares4UsDevelopment

Shares4UsDevelopment
05 Dec 2019, 14:21

Sample indicator showing Too many nested indicators created.
using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;

namespace cAlgo
{
    [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class TooMany : Indicator
    {
        string[] TestSymbols = { "EUR","USD","GBP","AUD","CAD","JPY","CHF","NOK","XAU","XAG","XPD","XPT","ZAR"};
        RelativeStrengthIndex RSI;
        protected override void Initialize()
        {
            foreach(string basepair in TestSymbols)
            {
                foreach(string counterpair in TestSymbols)
                {
                    if (basepair == counterpair) continue;
                    string SymbolName = basepair + counterpair;
                    try
                    {
                        Bars bars = MarketData.GetBars(TimeFrame.Minute, SymbolName);
                        if (bars == null)
                            RSI = null;
                        else
                            RSI = Indicators.RelativeStrengthIndex(bars.ClosePrices, 14);
                    }
                    catch (Exception ex)
                    {
                        Print(basepair + counterpair," ",ex.Message);
                        RSI = null;
                    }
                }
            }
        }

        public override void Calculate(int index)
        {
            // Calculate value at specified index
            // Result[index] = ...
        }
    }
}

 

Also you will notice that a line like "05/12/2019 13:18:11.948 | Failed to get symbol 'ZARXPT': symbol not found." is written in the log whilst it would be nicer to just throw an error that's catched with a try{}catch(e){} so we can choose to displays that message and is's not mandatory.


@Shares4UsDevelopment

Shares4UsDevelopment
28 Nov 2019, 16:37

RE:

Anyone any idea what this question is all about? I don't get it but i think it's necessary if he wants an answer?


@Shares4UsDevelopment

Shares4UsDevelopment
27 Nov 2019, 19:12

RE:

Hi Panagiotis,

Balance currency is the same as Quote currency in the example. (EUR vs EURNOK)
So the Required Margin should be

  • (RequiredMargin = Units / Leverage * Conversion Rate) = 39841 / 100 * 1 = 398.41
  • (UsedMargin = Balance - FreeMargin) => 1000 - 581.28 = 418.72

So Margin taken by ctrader is 418.72 whilst the required margin is 398.41 
Actualy a 1waycommission should be taken into account when determining the RequiredMargin.So:

  • (RequiredMargin = (Units / Leverage * Conversion Rate) = 1wCommission)= (39841 / 100 * 1) +1  = 399.41

Still a 19 Euro Gap

Shouldn't 418.72 and 399.41 match?


@Shares4UsDevelopment

Shares4UsDevelopment
27 Nov 2019, 16:29

RE:

Hi Panagiotis
Well that also matches at my end.
It's the outcome of the formula's I used that does not match!
I'd like to know:

Why those formula's are not OK, what is missing?

And why is there a difference in used margin/free margin when the Equity drops not that amount and the balance stays the same?


Cheers,
A.R.
BTW you used a spa feed not the mpa feed


@Shares4UsDevelopment

Shares4UsDevelopment
27 Nov 2019, 10:44 ( Updated at: 21 Dec 2023, 09:21 )

RE:

Hi Panagiotis,
Here is the data you need:
Broker FXpig 
Feed EURONOK.mpa  M15

Relevant code: (No need for the complete bot, The difference/problem is the same for every executed order)

 ExecuteMarketOrderAsync(TradeType.Buy, "EURNOK", 39841, "SBstHdg8", null, 65);  


 private void FTMO_OnPositionOpen(PositionOpenedEventArgs args)
        {
            Position pos = args.Position;
            double Comm1Way = 25;
            double Crossprice = 1;
            double StartBalance = 1000;
            double units = pos.VolumeInUnits;
            double entryPrice = pos.EntryPrice;
            double leverage = Account.PreciseLeverage;
            double pointPrice = Symbol.Bid;

            double tickSize = Symbol.TickSize;
            Print("\ttickSize\t", tickSize.ToString("F7"));
            double tickValue = Symbol.TickValue;
            Print("\ttickValue\t", tickValue.ToString("F7"));
            double symbolFactor = tickSize / tickValue;
            Print("\tsymbolFactor\t", symbolFactor.ToString("F7"));

            double spread = (entryPrice - pointPrice);
            Print("\tspread\t", spread.ToString("F7"));
            double spreadcosts = units * spread / symbolFactor;
            Print("\tspreadcosts\t", spreadcosts.ToString("F2"));

            double grossprofit = units * spread / symbolFactor;
            Print("\tgrossprofit\t", grossprofit);

            double commission1w = units * Comm1Way / 1000000;
            Print("\tcommission1w\t", commission1w.ToString("F2"));
            double commission2w = 2 * commission1w;
            Print("\tcommission2w\t", commission2w.ToString("F2"));

            double UnitsPrice = units / leverage * Crossprice;
            Print("\tUnitsPrice\t", UnitsPrice.ToString("F2"));

            Print("\tEquity\t" + (StartBalance - (units * spread / (tickSize / tickValue)) - (2 * units * Comm1Way / 1000000)).ToString("F2"));
            Print("\tGr.Prof\t" + (-units * spread / (tickSize / tickValue)).ToString("F2"));
            Print("\tNet.Prof\t", (-units * spread / (tickSize / tickValue) + (2 * -units * Comm1Way / 1000000)).ToString("F2"));
            Print("\tMarginRequired/Used\t" + ((units / leverage) + (units * (entryPrice - pointPrice) / (tickSize / tickValue))).ToString("F2"));
            Print("\tFree Margin\t" + (StartBalance + (-units / leverage) + (-units * (entryPrice - pointPrice) / (tickSize / tickValue))).ToString("F2"));

            Print("\tID\t",
               "AccCurr\t",
               "SymbolName\t",
               "TickSize  \t",
               "TickValue\t",
               "EntryPr.\t",
               "AskPrice\t",
               "BidPrice \t",
               "Volume\t",
               "Comm\t",
               "Balance\t",
               "Equity\t",
               "Lev\t",
               "Gr.Prof\t",
               "Net.Prof\t",
               "FreeMar\t",
               "UsedMar");
            Print("\t",
                pos.Id, "\t",
                Account.Currency, "\t",
                SymbolName.Left(6), "\t",
                Symbol.TickSize.ToString("F6"), "\t",
                Symbol.TickValue.ToString("F6"), "\t",
                pos.EntryPrice, "\t",
                Symbol.Ask, "\t",
                Symbol.Bid, "\t",
                pos.VolumeInUnits, "\t",
                pos.Commissions, "\t",
                Account.Balance, "\t",
                Account.Equity, "\t",
                this.Account.PreciseLeverage, "\t",
                pos.GrossProfit, "\t",
                pos.NetProfit, "\t",
                Account.FreeMargin, "\t",
                (Account.Balance - Account.FreeMargin).ToString("F2"), "\t");
            Stop();
        }


Output:


Position taken::

Event:

Hope it helps.

 


@Shares4UsDevelopment