Topics
Replies

firemyst
09 May 2023, 03:06

Just remove the "OUTPUT" directive and keep it as a "public" property.

 

For example, instead of this:

 [Output("Referenced SMA Output")]
 public IndicatorDataSeries refSMA { get; set; }

 

Make it this. Note that when doing it this way you will have to do a CreateDataSeries() in the Initialize method:

public IndicatorDataSeries refSMA { get; set; }

@firemyst

firemyst
09 May 2023, 03:03

If you need a work around, you can write your own indicator that combines the two into a single indicator area below the chart.

 

Also, you might want to do a search in the indicator archives to see if someone's already created one:

 


@firemyst

firemyst
07 May 2023, 14:22

RE: RE: RE:

meeting.chegini said:

firemyst said:

meeting.chegini said:

Hello
How do I know the name of the indicator in the IndicatorAreas?

For example, What is the name of the Chart.IndicatorAreas[0] indicator?

Try something like this:

Chart.IndicatorAreas[0].Objects[0].Name

Because each indicator area can have more than 1 object in it, you'll have to loop through all the objects to get all their names.

I don't want this!!

I want a code that gives me the name of the oscillator

 

I just gave you the general code above on what you have to do.

It's up to you to implement depending on the rest of your code.

I'm not going to write everything for you.

 


@firemyst

firemyst
05 May 2023, 17:49

RE:

meeting.chegini said:

Hello
How do I know the name of the indicator in the IndicatorAreas?

For example, What is the name of the Chart.IndicatorAreas[0] indicator?

Try something like this:

Chart.IndicatorAreas[0].Objects[0].Name

Because each indicator area can have more than 1 object in it, you'll have to loop through all the objects to get all their names.


@firemyst

firemyst
05 May 2023, 17:44

RE:

Samm193 said:

Dear All,

Can somebody help me with following. 

I have added Machine learning to my bot in Visual studio. 

When building the code into Ctrader, I get following error: 

 

Package Microsoft.Ml isn't supported

How can I solve it?

 

Thank you,

 

Step 1: Google the error message.

Step 2: Read the first response -- should be from GitHub - and try it.

 

 


@firemyst

firemyst
05 May 2023, 02:51 ( Updated at: 21 Dec 2023, 09:23 )

RE:

direcciongp said:

I select the + button in the watchlist menu and a search window opens, I type in a stock or a symbol (for example, Tesla or TSLA) and it doesn't work.

I

 

Works for me:

Then I left-clicked on "Tesla_Inc_(TSLA.O) and it was added:

 

Try making sure when you click on the symbol, you do a long left click to make sure you're clicking on it and it takes .


@firemyst

firemyst
04 May 2023, 14:09

RE:

PanagiotisChar said:

Hi firemyst,

I have no insight into the decision making process. I just explain how it works :) 

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us

I know. All's good. I'm not pointing fingers or anything at you :-)

I just can't believe some of the decisions Spotware makes at times. Almost every other app has developers that give users the choice of using a light, dark, or default system theme for using their software on mobile devices. Why Spotware decided to not do this as well (since they already had it as an option for charts) is just mind boggling.


@firemyst

firemyst
04 May 2023, 11:13

RE:

PanagiotisChar said:

Hi firemyst,

The new theme feature is set on the device level. So you need to set your device's theme as dark for cTrader to switch to dark mode.

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us

 

Thanks @PanagiotisChar

Why did they change it to the device level??

Other apps allow us to set "light", "dark", or "device default" in their settings. How come @Spotware couldn't do that with cTrader?

Like writing emails, most people have those apps in light mode; now I want to use cTrader with dark charts... I gotta switch over the entire phone? They couldn't even leave the option at the chart level?

*insert face palm emoji*


@firemyst

firemyst
03 May 2023, 09:12

RE: RE:

acrigney said:

Awesome thanks heaps mate, you have really saved my bacon!! What kind of bots do you build? I build ML ones.

 

 

I'm not sure what you mean by "ML" ones?

I write bots and a few custom indicators that do my trading for me. "Hybrid ones" where I have a basic strategy programmed up with position management, but watch the trades for divergences (and other signs) to manage them myself.

I used to focus on trading the daily time frame, but now stick more to Renko charts (with my own Renko Wicks indicator) to avoid all the noise distracting me or stimulating my emotions.

:-)

 

 


@firemyst

firemyst
03 May 2023, 06:15

> So sorry gus yes it worked with FullAccess using the launch debugger but it does not work with trying to attach, that is the normal way I try and do it with my bots.

> It says symbols have not been loaded. Looks like you have to specify the location of the symbols but I have never had to do that before.

 

Because everything now runs under its own process, you could have literally hundreds of calgo processes running, and wouldn't know which one to attach to.

The new way of debugging automatically handles that for you. When prompted, select the VS instance you're currently working in (as per the instructions on the web page) making sure you're running it in "debug" mode, and you'll be able to step through the code as per usual.


@firemyst

firemyst
03 May 2023, 05:08

RE: RE:

acrigney said:

Thanks mate, the debugger is not launched but the code says it was.

Also when I try and attach it says that no symbols have been loaded for the current document. 

As I said I have been doing this for years but ever since the upgrade to support .net 6 it has never worked.

Here is some sample code.

 

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

namespace cAlgo.Robots
{
    [Robot(AccessRights = AccessRights.None)]
    public class DummyBot6 : Robot
    {
        [Parameter(DefaultValue = "Hello world!")]
        public string Message { get; set; }

        [Parameter(DefaultValue = "Hello world!")]
        public string Message2 { get; set; }

        protected override void OnStart()
        {
            var result = System.Diagnostics.Debugger.Launch();

            if (result is false)
            {
                Print("Debugger launch failed");
            }
            else if (result is true)
            {
                Print("Debugger launched");
            }

            // To learn more about cTrader Automate visit our Help Center:
            // https://help.ctrader.com/ctrader-automate

            Print(Message);
            Print("onstart");
        }

        protected override void OnTick()
        {
            // Handle price updates here
        }
        
        protected override void OnBar()
        {
            double x = 0, y = 0, z = 0,p =0;
            Print("AddClose");
            for (int j = 0; j < 3; j++)
            {
                x = (float)Bars.ClosePrices.Last(j + 1);
                y = (float)Bars.OpenPrices.Last(j + 1);
                z = (float)Bars.HighPrices.Last(j + 1);
                p = (float)Bars.LowPrices.Last(j + 1);
            }
            Print(String.Format("lengths {0} {1} {2} {3}", x, y, z, p));


           

        }

        protected override void OnStop()
        {
            // Handle cBot stop here
        }
    }
}

PanagiotisChar said:

 

Hi there,

There are clear instructions here

Which step does not work for you?

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us

 

 

 

You need to follow the instructions. Your code clearly shows you haven't:

 


@firemyst

firemyst
02 May 2023, 04:12

I like a lot of your suggestions. However, given the limited screen size of phones, I suppose to what end are the majority of traders using mobile vs a laptop/desktop for their primary trading operations?

For instance, I'm curious why you think it's "high priority" to manage cbots through the mobile app itself? Since cBots run on the specific computer they are installed on, your mobile device would have to connect back to that computer (through cTrader) and be able to take control of the cbot on that computer. And there would be a lag doing so. Basically, it would be just as efficient right now to install Microsoft's "remote desktop" application on your mobile device, "remote desktop" back to your computer with the cBot installed, and control it remotely that way. That's what I do anyway -- to connect to my VPS where I have cBots running.

 


@firemyst

firemyst
01 May 2023, 02:38

So have you looked in the "logging" tab to see what errors (if any) are displayed?


@firemyst

firemyst
30 Apr 2023, 11:33

Are you using Visual Studio?

If so, are these NuGet packages that can be updated?

Are they DLLs that come from elsewhere that you do not have the source code to?

 

You need to provide more information


@firemyst

firemyst
28 Apr 2023, 17:26

RE: RE:

acrigney said:

Yes mate my boss have FullAccess but still no luck with any of the recent versions including the latest my broker TopDx has which is 4.6.6

Can you post a video showing creating and debugging a bot please?

 

Ever try doing a Google or YouTube search?

 


@firemyst

firemyst
28 Apr 2023, 15:36

And vote this thread too:

 


@firemyst

firemyst
28 Apr 2023, 15:35

RE:

ctid6027093 said:

Implement Renko wicks or if possible the full Renko range. I know there is an indicator that draw the wicks, but its using a lot of recources.

Having a full Renko implementation would give the platform a leap forward.

Regards

Would have been nice if you looked through the suggestions first instead of creating another thread to divide up the votes:

 

 

Vote in the above thread as well.


@firemyst

firemyst
27 Apr 2023, 16:10

RE:

jane.ttabloomquist said:

Hi, 

Many of the developers are waiting for encryption possibilities of code in cAlgo. This will open a broad marketplace for developers to monitize on their hard work. It will also bring new coders interesting in the platform. My question is, is this in progress? If so, when do you think it might be available.

cAlgo files are supposedly already encrypted - I doubt we'd get different types of "encryption" options though.

If you mean you want the code obfuscated, you can do that outside of cTrader before compiling.


@firemyst

firemyst
27 Apr 2023, 04:56

One thing to try that's happened to me in the past, is:

  1. put some indicators on the chart (a moving average, bollinger bands, etc) Just use the default settings
  2. try putting a horizontal and/or vertical line drawing on your chart as well
  3. scroll your chart. Change timeframe and scroll the chart again.

if you scroll your chart and the indicators  / lines do not move, then it's a bug with the Intel GPU drivers. This is known and has happened to me in the past. Update the Intel GPU drivers, restart cTrader, and hopefully it'll go away (as it did for me).

 

The other time something similar happened to me is when Windows automatically updated my computer in the background, and it was waiting for a pending restart. Once I restarted, it worked fine. So maybe check that as well.

 

If neither of these suit you, hopefully @Spotware can lend some insight. Great that you posted the video.

 


@firemyst

firemyst
27 Apr 2023, 04:49

Sample code snippets to get the size of the previous candle:

private Bars bars;

// In your OnStart or Initialize method depending on whether cBot or indicator
bars = MarketData.GetBars(Chart.TimeFrame);


//In the Calculate, OnTick, or OnBar method depending on whether indicator or cBot and when you want to know the difference
//If you want the body size
double differenceInPips = Math.Abs(bars.OpenPrices.Last(1) - bars.ClosePrices.Last(1)) / Symbol.PipSize;

//If you want the entire candle. No Math.Abs function needed
double differenceInPips = (bars.HighPrices.Last(1) - bars.LowPrices.Last(1)) / Symbol.PipSize;

 

 

Check out code samples to see how to place the order you want:
https://help.ctrader.com/ctrader-automate/cbot-code-samples/

 


@firemyst