Topics
11 Nov 2020, 22:19
 2009
 5
26 Jun 2020, 16:07
 1355
 7
21 Sep 2018, 16:22
 1959
 2
30 Jun 2018, 12:58
 1409
 4
29 May 2018, 12:32
 0
 1833
 4
03 May 2018, 13:30
 0
 1509
 1
02 May 2018, 19:08
 1839
 1
Replies

irmscher9
30 Mar 2018, 11:20

Yes, that would be wonderful.

Well, actually 10k was enough for me too up until I have implemented a number of Trailing Stop blocks in my bot so every time the position is modified it gets outlined in the log and I think it takes like 50-70% of the space.

Actually if there would be 10k limit solely for "Info" section of the log, that would be OK I guess.

 


@irmscher9

irmscher9
29 Mar 2018, 18:05

Panagiotis, but why is it limited to 10000 records? It's not a web application that's consuming server resources...

It's just a bit weird. Now it seriously hurdles my backtesting process. Even if I make it export to csv it will significantly slow down the whole process.

So I'm wondering what is the actual reason for limiting it to 10k?


@irmscher9

irmscher9
29 Mar 2018, 13:45

Thanks Panagiotis :)


@irmscher9

irmscher9
29 Mar 2018, 12:00

What do you mean by "save these messages yourself in a csv file"

How do I do that?


@irmscher9

irmscher9
28 Mar 2018, 19:50

Right, Ok, I think I know what the issue might be.

In order to calculate rows I've right-clicked on the Log, copied all and then pasted to Excel spreadsheet. Yes, it's showing 10k rows.

But the problem is, most of the rows are taken by things like this "22/11/2017 08:14:04.056 | → Modifying position PID608 (SL: 1.17568241403729, TP: null) SUCCEEDED, Position PID608". 

So I guess it's 10k but for not only my outputs. How do I make those "Modifying position" messages not show up? 10k will be enough then I guess.

By the way, why is it limited to 10k?


@irmscher9

irmscher9
28 Mar 2018, 13:18

Everything was OK with that version up until recently. Only half of 2014 year log data has been cut but I thought it's because I output too much "Print" commands. Now I don't know...


@irmscher9

irmscher9
28 Mar 2018, 12:49

2.1


@irmscher9

irmscher9
22 Mar 2018, 14:32

I'm planning to run 1 robot in cAlgo on that VPS. Couple of trades a week. 

Well, main issue could be Orders delay. My bot is very dependant on strong impulses so a few millisecond delay might cost me a few pips. Can 1 core potentially cause me those troubles?


@irmscher9

irmscher9
22 Mar 2018, 12:57

But is it OK to run 1 bot on cAlgo on single-core VPS? Or is it better to get at least 2 cores?


@irmscher9

irmscher9
16 Mar 2018, 18:49

Backtesting of Multiple Symbols in on bot still not supported?


@irmscher9

irmscher9
16 Mar 2018, 11:35

Yeah, right. Changed my account with ICM markets and removed the old demo accounts, that's why the default AUD account shown up. Thanks for prompt reply! 


@irmscher9

irmscher9
13 Mar 2018, 17:09

Is it supposed to be like that or should there be a simplier way in the future updates?


@irmscher9

irmscher9
27 Feb 2018, 13:59

Yes, OK.

But why does the bot open 4 positions simutenously when it really not supposed to (screenshot):

https://1drv.ms/u/s!AvJJop5QTya76VVTV6sJA6uzm_OW


@irmscher9

irmscher9
22 Feb 2018, 12:54

I don't get it, what kind of market conditions can explain the ignoring of Stop Loss...

Any ideas? Is there anything can be done about it?


@irmscher9

irmscher9
22 Feb 2018, 12:51

Ok, I got in touch with ICMarkets, and here's what they told me:

	
Andrey Kurnikovs Friday at 14:48
Hi 
I have an issue with USD CHF backtesting data 
I have contacted the cTrader 
CTDN.com 02:38:01 pm 
they said I should better get in touch with my broker regarding this 
here it is:

https://1drv.ms/i/s!AvJJop5QTya752oATrHxHUw6_DCz 
(this is a one drive link) 
(Microsoft one drive shared) 
and 02:39:08 pm 
/guides/images/4b4095a6867d0a0da688d9980e647bf865fa3b84.png 
both cases ignore stop loss 
If something like that happened in real trading mode, my whole account 
would be depleted for nothing...

Is this a bug or a real backtesting data? If yes, then how to avoid this. 
Why the positions ignore Stop Losses.

Thanks
We apologize for the delay to respond your email.

Kindly inform that we have checked your query and screenshots, however, it is not clear which stop losses that were "ignored" you are referring to .

The screenshot you have provided is referring the USDCHF chart dated January 15, 2015 which is when there was a huge flash crash on CHF currency . You may find many economical articles in this regard e.g. https://www.forbes.com/sites/deanpopplewell/2015/01/15/flash-crash-ensues-after-swiss-drop-euro-cap/#137788666359 .

You may take a look at this article https://www.financemagnates.com/forex/brokers/ic-markets-covering-90-client-negative-losses-swiss-franc-volatility/ informing what actions ICMarkets took to assist clients with the losses they have encountered.

I hope it clarifies your query. Should you not hesitate to contact us if you require any further information.
Ok. All my positions on this bot have 60pips Stop Loss.

As you can see it works on this position: https://1drv.ms/u/s!AvJJop5QTya76VVTV6sJA6uzm_OW

But completely ignored on the following: 
https://1drv.ms/u/s!AvJJop5QTya76VTz3uozzPv87SSU

On top of that, somehow, a number of positions have been opened resulting in a 4,500x4 loss (you can see that on both screenshots on the bottom of the screen)
Dear Andrey,

That is expected movement on such uncommon market conditions as during CHF crash. Unfortunately, we are not able to assist with your backtesting program.

If you have any recent live account trade inquiries , we will be happy to investigate, however, we are not able to conduct investigation on your cbot tests. Apologize for the inconvenience.

 


@irmscher9

irmscher9
22 Feb 2018, 12:34

Hi there. And why would you want to transfer your bots from MT4,5 to cAlgo, may I ask?

 


@irmscher9

irmscher9
20 Feb 2018, 17:16

Ok, thanks, a lot.


@irmscher9

irmscher9
20 Feb 2018, 12:22 ( Updated at: 21 Dec 2023, 09:20 )

Sure!

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 NewcBot : Robot
    {
        //--TODO:
        //-- 1. Chaikin Volotility, if above 500 - don't trade for X amount of time.

        [Parameter("Source")]
        public DataSeries SourceSeries { get; set; }

        [Parameter("Take Profit", DefaultValue = 90, MinValue = 60, Step = 5, MaxValue = 120)]
        public int TP { get; set; }

        [Parameter("dmsC", DefaultValue = 4, MinValue = 3, Step = 1, MaxValue = 15)]
        public int DMSC { get; set; }

        [Parameter("Chaikin Value", DefaultValue = 100, MinValue = 25, Step = 1, MaxValue = 125)]
        public int cknValue { get; set; }

        [Parameter("Donchain Periods", DefaultValue = 20, MinValue = 10, Step = 1, MaxValue = 30)]
        public int dncPeriods { get; set; }


        public DonchianChannel _dnc;

        public DirectionalMovementSystem _dms;

        public ChaikinVolatility _ckn;

        public CommodityChannelIndex _cci;

        public RelativeStrengthIndex _rsi;

        public MacdHistogram _mcd;

        public ExponentialMovingAverage _ema50;

        public int buyPeriods;
        public int sellPeriods;


        protected override void OnStart()
        {

            _dnc = Indicators.DonchianChannel(dncPeriods);

            _dms = Indicators.DirectionalMovementSystem(14);

            _ckn = Indicators.ChaikinVolatility(14, 10, MovingAverageType.Simple);

            _cci = Indicators.CommodityChannelIndex(20);

            _rsi = Indicators.RelativeStrengthIndex(SourceSeries, 21);

            _mcd = Indicators.MacdHistogram(50, 15, 9);

            _ema50 = Indicators.ExponentialMovingAverage(SourceSeries, 50);

            Print("The current symbol has pip size of: {0}", Symbol.PipSize);

        }

        protected override void OnTick()
        {
            //--
            var positionBUY1 = Positions.Find("Buy1");
            var positionSELL1 = Positions.Find("Sell1");

            //-- current price
            double ask = Math.Round(Symbol.Ask, 5);
            double bid = Math.Round(Symbol.Bid, 5);
            double current_price = (ask + bid) / 2;

            //----- dmsC
            double dmsD0 = _dms.DIPlus.Last(0) - _dms.DIMinus.Last(0);
            double dmsD1 = _dms.DIPlus.Last(1) - _dms.DIMinus.Last(1);
            double dmsC = dmsD0 - dmsD1;

            bool rsi30_20 = _rsi.Result.Minimum(20) <= 30;
            bool rsi70_20 = _rsi.Result.Maximum(20) >= 70;

            double C = (current_price - _ema50.Result.LastValue) * 1000;


            //-- && HeikenC > -17 
            if (_ckn.Result.LastValue > cknValue && dmsC > DMSC && positionBUY1 == null && positionSELL1 == null)
            {
                ExecuteMarketOrder(TradeType.Buy, Symbol, 100000, "Buy1", 60, TP);
                //buyPeriods = 0;

            }

            //-- && HeikenC < 17
            if (_ckn.Result.LastValue > cknValue && dmsC < -DMSC && positionBUY1 == null && positionSELL1 == null)
            {
                ExecuteMarketOrder(TradeType.Sell, Symbol, 100000, "Sell1", 60, TP);
                //sellPeriods = 0;

            }

        }

        protected override void OnBar()
        {

            //-- positions
            //-- find positions
            var positionBUY1 = Positions.Find("Buy1");
            var positionSELL1 = Positions.Find("Sell1");


            //-- buy && sell periods
            if (positionBUY1 != null)
            {
                buyPeriods++;

            }

            if (positionSELL1 != null)
            {
                sellPeriods++;

            }
        }
    }

}

Parameters:


@irmscher9

irmscher9
14 Feb 2018, 15:20 ( Updated at: 21 Dec 2023, 09:20 )

Or, rightClick->goTo.


@irmscher9

irmscher9
10 Feb 2018, 15:28

The code above seem doesn;t work...


@irmscher9