stuart's avatar
stuart
stuart's avatar

Info

Username:stuart
Name:stuart
Member since: 24 Jan 2018

About

None

Signature

None

Last Forum Posts

@Unable to change the name of cBot or Indicator:  25 Jan 2023, 07:26


firemyst said:

What provider and version of cTrader are you using?

And just to be sure, you've been trying to change your indicator names in the left panel when you click on "automate"?

Hi,

Thank you for replying.

I use v4.4.23  with IC Markets  but also have v4.5.6 with FTMO 

I am using the left panel to Rename the file, like i have done many times.

I either get  access denied error  . hxxps://www.screencast.com/t/WccsUMr2PxDU   (change xx to tt to view)

or a permissions error:   see:  hxxps://www.screencast.com/t/AWr5mjTt     (change xx to tt to view)

Both my username and SYSTEM have  Full Control in security of the folder.  But Read Only is always checked, even if I uncheck and allow the explorer to change files and folders.

I would appreciate any pointers/ideas to help debug this one.

@Unable to change the name of cBot or Indicator:  24 Jan 2023, 07:00


Hi,

I am unable to change the name of any new cBots or Indicators I create.

I get permissions denied , but nothing has changed.

All new Indicators are now  New Indicator (10) etc..

any idea how to fix?

@How to access List of tick prices for the candle using onBar():  21 Feb 2022, 11:16


ok thank you for your reply. and also for the code, that gives me a good idea. 

Stuart

amusleh said:

Hi,

There is no API feature that allows you to load a bar tick data.

For new real time bars you can record each bar tick data by using OnTick or Calculate method.

For historical bars there is no practical way to do this, you can load the tick data of a symbol and then filter each bar tick data by using its open time but loading all historical bars tick data can get lots of time.

As an example:

using System.Linq;
using cAlgo.API;
using cAlgo.API.Internals;
using System.Collections.Generic;

namespace cAlgo.Robots
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class NewcBot : Robot
    {
        private readonly Dictionary<int, Tick[]> _barTicks = new Dictionary<int, Tick[]>();

        protected override void OnStart()
        {
            var ticks = MarketData.GetTicks();

            // This can take very long time based on number of bars and their time frame
            while (ticks[0].Time > Bars[0].OpenTime)
            {
                var loadTicksNumber = ticks.LoadMoreHistory();

                if (loadTicksNumber < 1) break;
            }

            Print(ticks[0].Time, " | ", Bars[0].OpenTime, " | ", ticks.Count, " | ", Bars.Count);

            // For historical bars
            for (int barIndex = 0; barIndex < Bars.Count; barIndex++)
            {
                Tick[] barTicks;

                if (barIndex == Bars.Count - 1)
                {
                    barTicks = ticks.Where(tick => tick.Time >= Bars[barIndex].OpenTime).ToArray();
                }
                else
                {
                    barTicks = ticks.Where(tick => tick.Time >= Bars[barIndex].OpenTime && tick.Time < Bars.OpenTimes[barIndex + 1]).ToArray();
                }

                _barTicks.Add(barIndex, barTicks);
            }

            // Now each bar ticks are stored inside _barTicks dictionary and you can access them with bar index
            Print("All bars ticks are saved on _barTicks");
        }
    }
}

@How to access List of tick prices for the candle using onBar():  20 Feb 2022, 12:50


Hi

How to access List<> of tick prices for the candle using onBar() 

So i dont want to use the onTick and build up a list, but use the MarketData.getTicks() and get the last x amount of tick that were in the Bar just closed. 

I guess i need the tick index, but how can i access it?

thank you

@Notifications.SendEmail() does not work:  29 Aug 2020, 00:17


try a different email provider. 

I also could not get gmail to work with cTrader.

@Need help finding an Indicator that shows the SMA over multi time frames:  14 Jul 2019, 08:48


I had this indicator before, but I must have removed it. So i know its around. 

It showed a table with about 5 timeframes and in each cell showed red or green depending if the SMA was rising or falling for about 5 different Timeframes 

any help in locating it would be appreciated 

@How can I show indicator on graph, from bot?:  14 Jul 2019, 08:43


The cBot will not show the indicator, as far as I know. 

you need to manually add that indicator as you normally would. and set the settings the same as you have then in your bot to have any meaning.

it feels odd that you need to do it separately but i think its the only way.

@How do I lock the x-axis:  14 Jul 2019, 08:35


How do I lock the x-axis   which is the PIPs side. 

I need to hold the scale to keep the context when scrolling back

@Menus to much space and text is blurred:  29 Jun 2019, 13:46


I agree, we dont need that much space in the menus.

keep it tight.

@Chart.DrawText on each candle:  29 Jun 2019, 12:53


stuart said:

I am trying to get Chart.DrawText()  to draw text under each candle. 

but i only get text on the most recent candle  [index]

in Calculate() i have

Chart.DrawText("UPDOWN", i.ToString(), i, MarketSeries.Low[i] - 5, "#8fb300");

how do i get it to work on each candle?

I tried the Obsolete ChartObjects.DrawText  and it works as expected.

so why does the new Chart.DrawText not work the same way?

i feel like we are in the dark with these updates.

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.