Replies

Drummond360
11 Dec 2019, 11:04

RE: RE: RE: RE:

Drummond360 said:

ClickAlgo said:

I think this would be a question for Spotware or your broker, sorry, I am unsure of the answer on this one.

No worries Paul, thank you again for your help, fingers crossed Panagiotis and co will post an answer... Hope you're well...

 

 

I guess I'll just use a limit order with an immediate execution as this would be honoured at the target price or better, right?

var targetPrice = Symbol.Bid


@Drummond360

Drummond360
04 Dec 2019, 22:50

RE: RE: RE:

ClickAlgo said:

I think this would be a question for Spotware or your broker, sorry, I am unsure of the answer on this one.

No worries Paul, thank you again for your help, fingers crossed Panagiotis and co will post an answer... Hope you're well...


@Drummond360

Drummond360
04 Dec 2019, 13:17

RE:

ClickAlgo said:

Hi, Drummond,

I am pretty sure this has been documented, but it may be a little outdated due to many new features being added to the platform lately, take a look at the link below which covers the latest build of cTrader, the method you are looking for is ExecuteMarketRangeOrder.

https://clickalgo.com/ctrader-market-orders

Paul Hayes
Sales & Marketing
Emailcontact@clickalgo.com
Phone: (44) 203 289 6573
Websitehttps://clickalgo.com

Twitter | Facebook | YouTube | Pinterest | LinkedIn

PS: Why not join our instant chat group on Telegram or visit our YouTube Channel

That's great thank you Paul, much appreciate...

 

Using ExecuteMarketRangeOrder seems a bit limiting to me, what if the re-quote is favourable? Am I correct in thinking that setting a range prevents the slippage for both negative and positive outcomes??!?!

 

Ideally we would simply state that if the re-quote goes against us we don't wish to place the order...?


@Drummond360

Drummond360
11 Feb 2018, 23:55

Ah that simplifies the whole thing! Thank you very much Markae...


@Drummond360

Drummond360
01 Feb 2018, 17:55 ( Updated at: 21 Dec 2023, 09:20 )

RE: RE: RE:

 

Nice stats! Might you be interested in collaborating? Drop me an email if you'd like to discuss? ian@3sixty.me.uk

 

 

markae said:

You said it already correct:

Drummond360 said:

In theory, if...

I'm sorry to say, that those backtests never represents how your cBot would work in a real live environment. There are a lot of other factors which need to be considered, for example slippage, execution delay, variable spreads and so on.

I have some robots which really works, but the backtests are looking by far not so fantastic. Here is an example of one of my bots for EURUSD (01/01/2016-31/01/2018, Commission of $3 per round turn lot)

And here my first forward test on demo with 3 of my cBots running on the same account (since monday I have it running on a live account too):

 


@Drummond360

Drummond360
01 Feb 2018, 11:34

RE: RE:

Fantastic, thank you Markae...

markae said:

Just check if it is still "false" and only then check the "price"-Value. Once it becomes true stop checking the price value

bool FirstFibLevel = false;

if(!FirstFibLevel)
{
    if (price < 7)
    {
        FirstFibLevel = true;
    }
    else
    {
         FirstFibLevel = false  // not really necessary
    }
}

if (FirstFibLevel)
{
    Place order to enter trade at 10
}

 

 

 


@Drummond360

Drummond360
01 Feb 2018, 11:33 ( Updated at: 21 Dec 2023, 09:20 )

RE:

Looks like you got it! Well played sir!....

To answer your questions;  I've found plenty of backtesting dates where this works but due to the high volume of trades I can only get a complete backtest on a very small date range... 

In theory, if you have an STP broker there's no reason why this can't work on a live account. I'll be checking for these conditions onTick with every robot I make from now on, even if it never places a trade at least I know the potential is there...

 

markae said:

Okay, I think I got it :-D

 


@Drummond360

Drummond360
31 Jan 2018, 11:56 ( Updated at: 21 Dec 2023, 09:20 )

If you liked those results check out this little weapon!

 


@Drummond360

Drummond360
31 Jan 2018, 10:48

Thanks, yes Stochastics and RSI... Entering with trailing stop orders....

But the entry doesnt really matter... As mentioned in my last post the trailing stop loss was showing false profit, once tested with tick data it all fell apart....


@Drummond360

Drummond360
30 Jan 2018, 17:17

That's fixed it! Thank you once again....

Drummond


@Drummond360

Drummond360
30 Jan 2018, 17:08

Thank you fo rthe quick reponse Panagiotis...

Changing the value to 8 returns this result:

abcSL = 5E-08 

abcTP = 9E-08

Still no good as a calculation of pips to use for StopLoss / TakeProfit levels...

 


@Drummond360

Drummond360
30 Jan 2018, 16:56

Yes, I dissproved these results, here's a quick summary;

These results are backtested on 1 minute bars. As this form of backtesting only respects the open price the back test assumed that my trailing stop was always honoured at the 5 pip level it was set to, however Tick data testing showed that my trailing stop was being hit well before the next bar opened and actaully returning a loss more often than a profit...

I'll be testing everything with Tick data from now on!

Drummond

 


@Drummond360

Drummond360
30 Jan 2018, 15:37

Thank you, great support, much apreaciated...

Drummond


@Drummond360

Drummond360
30 Jan 2018, 11:38

Hi Panagiotis,

I'm using 1 minute bars...

Many thanks,

Drummond


@Drummond360

Drummond360
30 Jan 2018, 11:02

Thank you Panagiotis,

Here's a simplified version of the code, still putting out the same error message.

using System;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;

namespace cAlgo
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class FIBBOT : Robot
    {
        [Parameter("TP Pips", DefaultValue = 10, MinValue = 1)]
        public int takeProfitPips { get; set; }

        [Parameter("StopLossPips", DefaultValue = 1, MinValue = 1)]
        public int stopLossPips { get; set; }

        [Parameter("Periods", DefaultValue = 20)]
        public int period { get; set; }

        public DataSeries series { get; set; }

        string label = "Fib Bot";

        protected override void OnStart()
        {

        }
        private int HighestBar(DataSeries series, int period)
        {
            for (int i = 0; i <= period; i++)
            {
                if (series[series.Count - 1 - i] == series.Maximum(period))
                {
                    return i;
                }
            }
            return -1;
        }

        private int LowestBar(DataSeries series, int period)
        {
            for (int i = 0; i <= period; i++)
            {
                if (series[series.Count - 1 - i] == series.Minimum(period))
                {
                    return i;
                }
            }
            return -1;
        }


        protected override void OnTick()
        {



            int x = HighestBar(series, period);
            Print(" HighestBar = " + x);
            int y = LowestBar(series, period);
            Print(" LowestBar = " + y);




            if (x > y)
            {
                ExecuteMarketOrder(TradeType.Buy, Symbol, 10000, label, stopLossPips, takeProfitPips);



            }
        }
    }
}





 


@Drummond360

Drummond360
29 Jan 2018, 22:32

int x = HighestBar(series, period);
int y = HighestBar(series, period);

if (x > y)
{ 
do something 

This is the best I have in me! It compiles fine but returns this error...

Crashed in OnTick with NullReferenceException: Object reference not set to an instance of an object.

I can't even get a print statement in the log... Normally my go to for fault finding...

If anyone can humour me it would be greatley appreciated!

Many thanks,

Drummond 


@Drummond360

Drummond360
25 Jan 2018, 17:03

Hi Panagiotis,

Thankyou for such a detailed and concise reply, much appreciated...

Drummond...


@Drummond360

Drummond360
25 Jan 2018, 17:01

Hi,

Could you please explain how to invoke these methods?

How to do we say 'if HighestBar came before LowestBar'

Sorry for being such a coding novice!

Thanks in advance,

Drummond...

 


@Drummond360

Drummond360
24 Jan 2018, 18:45 ( Updated at: 25 Jan 2018, 11:32 )

Hi,

Can you please confirm if this response from Spotware is still valid? 

After doing some backtesting I saw some remarkably unrealistic results where I could trade a £1000 account up to over a billion in a day! 

I contacted my broker, FxPro, who were an ECN broker when I signed up a while back... I asked them about their negative spreads of upto -19 pips which created my crazy results. I asked if they are allowing their clients to trade the interbank spread without a mark up as I have previously read on their website...

Their response was that they are not an ECN broker, that they won't allow negative spreads and that they will 'sometimes' apply a mark up to their spreads in cTrader...

Can Spotware please reply to reasure it's users that either 

a) cTrader is indeed solid and no broker can manipulate the interbank spread?

and / or

b) Supply a list of genuine ECN brokers who offer an honest service?

Many thanks in advance...

Drummond


@Drummond360

Drummond360
23 Jan 2018, 23:48

Thank you Panagiotis,

I'll message my broker...


@Drummond360