dave.anderson.consulting
dave.anderson.consulting's avatar

Info

Username:dave.anderson.consulting
Name:dave.anderson.consulting
Member since: 18 Dec 2020

About

None

Signature

None

Last Algorithm Comments

@Cumulative Delta Volume:  07 Oct 2022, 12:19


I appreciate your effort. But this is actually a kind of volume of the ticks and not the actual volume of the contracts that have been traded. The cTrader has 'tick volume' or simply put 'number of ticks'. One can take a position with 10 contracts at a given price. Another can take 0.1 position on the same price. In reality it means 10.1 volume contracts at that particular price. But cTrader sees that as a single tick, because all the contracts were at the same price. If the first person with 10 contracts on price x had taken position and second person 0.1 contract on price x+1 had taken position. Then the tick volume on first price (of 10 contracts) was 1 and tick volume on second price (of 0.1 contract) was also 1. Because tick is a price change and has nothing to do with number of contracts at a specific price. Because cTrader only has the number of ticks and no volume of contracts, this indicator or any other that does anything with volume is misleading.

@Tick Volume Delta:  07 Oct 2022, 12:19


I appreciate your effort. But this is actually a kind of volume of the ticks and not the actual volume of the contracts that have been traded. The cTrader has 'tick volume' or simply put 'number of ticks'. One can take a position with 10 contracts at a given price. Another can take 0.1 position on the same price. In reality it means 10.1 volume contracts at that particular price. But cTrader sees that as a single tick, because all the contracts were at the same price. If the first person with 10 contracts on price x had taken position and second person 0.1 contract on price x+1 had taken position. Then the tick volume on first price (of 10 contracts) was 1 and tick volume on second price (of 0.1 contract) was also 1. Because tick is a price change and has nothing to do with number of contracts at a specific price. Because cTrader only has the number of ticks and no volume of contracts, this indicator or any other that does anything with volume is misleading.

@Variable Moving Average (VMA):  15 Apr 2022, 15:29


Hi, Do you happen to know which formula cTrader uses for VIDYA? Because that is very different from this VMO.

@Custom Renko Chart (Overlay):  08 Mar 2022, 14:22


This is amazing. I truly appreciate your work on Renko bars and everything else you do on development. I wanted to extend the output properties with StartTime and EndTime of the higher Renko timeframe but the chart got really funny. All bars were flat at the bottom of the chart. I hope I can find a way to fix that and report it back here.

@Renko Volume Heat map:  12 Dec 2021, 18:21


By the way I would take the bar color out. That doesn't add much and actually gets in the way a bit and creates confusion.

@Renko Volume Heat map:  12 Dec 2021, 18:18


I looked at the result and compared it with the minute bar volumes. Every random sample I took were wrong! Several times I took a bar at a random Renko bar within a chart that took several minutes to form. Then I compared the total minute volumes with those of the Renko. I even omitted the first and last minute volumes and yet the volumes on the Heat map were less than (sometimes half) the minute volumes. I appreciate the efforts of the co-developers who make these kinds of ideas available to others. But I do find it a pity that little or no checks are made on the correctness of the result.

@Supertrend MTF:  27 Feb 2021, 12:07


First of all I would like to thank the developer of this indicator and for making the code available. But .... a very important but .... There is a big issue in this indicator. The higher timeframe dots do not repaint on the lower timeframe! If you put an hourly timeframe of this indicator on the M15 chart, you will see that the dots of hourly are up and down on the previous M15 bars. No matter what timeframe, during the formation of the last bar, every indicator should repaint on that last bar. For the same reason on the MTF version of every indicator, the indicator should repaint on the last bar of the higher timeframe on lower charts. So in case of above example, all of the dots of the hourly supertrend should repaint on the M15 chart for that hour. Until the hourly bar is closed. In short, do not use this indicator until the repaint issue is resolved.

@TrendZone Price - Heiken Ashi pro:  11 Feb 2021, 23:53


How can this be used in a cBot?

@All Pivots:  07 Jan 2021, 16:10


This indicator does not calculate correctly on Renko or Range charts. Probably because there is no predefined time on those charts. In those cases the opentime of the current minute bar should be used to do the calculation.

Last Forum Posts

@​cTrader Desktop 4.6.2 bug - On backtesting MTF Range bars, the higher bars does not updated:  28 Jan 2023, 16:27


I would like to report a bug.

cTrader version: 4.6.2.12995 (latest)

 cTrader Automate nuget package: 1.0.6 (latest)

Using below example cBot, you can see that in case of BackTest on Range20 OpenPrices from server option, the higher timeframe bars does not update!
But if you run BackTest on Tickdata from server, then everything is correct.


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

namespace cAlgo.Robots
{
    [Robot(AccessRights = AccessRights.None)]
    public class NewcBot : Robot
    {
        [Parameter("Current Chart TimeFrame", DefaultValue = "Ra20")]
        public TimeFrame TF_1 { get; set; }

        [Parameter("Higher TimeFrame", DefaultValue = "Ra200")]
        public TimeFrame TF_2 { get; set; }

        private Bars _currentChartBars, _higherTimeFrameChartBars;
        protected override void OnStart()
        {
            _currentChartBars = MarketData.GetBars(TF_1);
            _higherTimeFrameChartBars = MarketData.GetBars(TF_2);
        }

        protected override void OnBar()
        {
            if (Bars.LastBar.OpenTime > new DateTime(2023, 1, 27, 12, 0, 0)
                && Bars.LastBar.OpenTime < new DateTime(2023, 1, 27, 16, 0, 0))
            {
                // This is the current chart timeframe which is Range20. This is always right.
                Print("Range 20: " + _currentChartBars.LastBar.OpenTime.ToString("yyyy-MM-dd HH:mm:ss.fff"));

                // This is the higher timeframe
                // Wrong --> when used with Range20 openprices from server option. (Note that this is higher timeframe and not chart timeframe.)
                // Right --> when used with EveryTick from server option.
                Print("Range 200: " + _higherTimeFrameChartBars.LastBar.OpenTime.ToString("yyyy-MM-dd HH:mm:ss.fff"));
            }
        }
    }
}

@What's New in cTrader Desktop 4.6:  25 Jan 2023, 11:34


Awesome!
Big, useful and necessary features that I and probably many algo developers have been waiting for. These additions alone were enough to bring me back to cTrader. Can't wait to rewrite my algos back to cTrader.
Especially Renko-Range backtest and optimization possibilities are a very big improvement. But Local Storage and Rate Conversion are also great enrichments.

I don't know what or who put this on the agenda and made it possible, but I am very grateful. Very much appreciated.

@What's New in cTrader Desktop 4.4:  26 Oct 2022, 18:22


It would have been nice if Spotware finally paid some attention to the long-awaited non-time based backtesting and optimization. Although I can load the data into NinjaTrader via a NinjaTrader connector and test my cTrader algo there, I would prefer to do it directly on the cTrader itself.

In addition, it would be nice if the code of built-in indicators was made publicly available. That would boost the algo trading and tooling development on the cTrader. In some cases there are strange differences with the built-in indicators on other platforms such as NinjaTrader and MetaTrader4/5. That makes it more difficult for an algo trader/developer and financially less interesting to make the same tooling for cTrader.

@built-in vidya indicator formula:  25 Apr 2022, 12:21


Hi,

I would like to know which formula is used for the built-in VIDYA indicator. From the parameters of the indicator I get the impression that the first original formula is used where there is a sigma involved. But unfortunately I can't find a C# translation of the formula anywhere on the internet.

Can someone help with that?

Thank you in advance

@How to reference custom indicator in Visual Studio:  02 Apr 2022, 12:14


I have the exact same problem. In Visual Studio I get the same error.

Has anyone figured out what could be going on here?

@With MarketSeries Obsolete how can I create a custom Bars datasource to use with indicators?:  05 Mar 2021, 21:05


Hi,

Is there any workaround for this to use custom bars (like RenkoBars) with indicators?

Regards,

Dave

@Renko/Range Backtest:  26 Feb 2021, 21:59


The only dll used is the cAlgo.API.dll and that is from cTrader itself. The afhacker's code makes use of this dll that you already have on your cTrader installation.

The only problem is that some parts of the afhacker's code is not fully implemented yet. Therefore, you might get different error messages depending on which piece of code you are using.

He is aware of this but had no time to fix it.(see: https://github.com/afhacker/cAlgo.API.Extensions.Series/issues/2 )

But honestly, not being able to back test Renko bars is actually something Spotware / cTrader has to fix.

To me Renko is a half baked feature in cTrader.

Until the time of writing this post no one has managed to have a working workaround to backtest Renko bars on cTrader.

@Optimizer fails with exception ArgumentOutOfRangeException:  21 Dec 2020, 17:09


PanagiotisCharalampous said:

Hi dave.anderson.consulting,

In optimization, you cannot get bars from other timeframes before the backtesting start date. You can only get such bars from the date and time the execution has started and onwards. I hope it is clearer now.

Best Regards,

Panagiotis 

Join us on Telegram

Hello Panagiotis Charalampous,

Thanks for your quick response.

I think I understand now :-(
The misunderstanding was probably due to my creativity to get around cTrader shortcomings. I wanted to use Optimization for my Renko MTF bot using a mix of the above information and the information I found in your other post at https://ctrader.com/forum/cbot-support/23640.
But unfortunately that is not possible, I now understand.

I come from MT4 algotrading and am pretty good at it. But I am even better at C#. Hence I thought instead of switching to MT5 I can use cTrader. At first it seems that cTrader has many useful features that MT4 and sometimes even MT5 do not have. But in practice, most features still seem immature or incomplete.

@Optimizer fails with exception ArgumentOutOfRangeException:  21 Dec 2020, 14:00


PanagiotisCharalampous said:

Hi driftingprogrammer,

This happens because

Bars tempBars = MarketData.GetBars(TimeFrame.Minute15);

does not return any values in OnStart(). Unfortunately getting past bars from other timeframes is not supported at the moment in Optimization. You can only get bars from other timeframes that are constructed during the time the cBot is running. If your cBot logic allows it, here is a workaround to consider.

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

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

        protected override void OnStart()
        {

        }

        protected override void OnBar()
        {
            Bars tempBars = MarketData.GetBars(TimeFrame.Minute15);
            if (tempBars.Count > 0)
            {
                Print("Printing tick volume " + tempBars.Count);
            }
        }

        protected override void OnStop()
        {
            // Put your deinitialization logic here
        }
    }
}

Best Regards,

Panagiotis 

Join us on Telegram

Unfortunately it is sill unclear to me what is really supported and what is not supported regarding getting historical bars of different timeframes while optimization is running.

Does this mean that if I move the code from OnStart to OnTick or OnBar as you suggested, it would work in Optimization? Or getting past bars from other timeframes is 'always' impossible in Optimization? Because in last case, the cTrader Optimization would be useless!

I would greatly appreciate if you explain it in more detail.

Notification Publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section you may use the Copyright Infringement Notification form to submit a claim.

No uploaded.

Warning! Executing cBots downloaded from this section may result in loss of funds. Use them at your own risk.

No uploaded.