Replies

AlgoCreators
18 May 2023, 20:45

RE: RE: RE: RE:

firemyst said:

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.

 

Dear friend, do you want to teach me how to split the nucleus of an atom?
This is a simple question! If you know the solution, please guide me


@AlgoCreators

AlgoCreators
07 May 2023, 14:07

RE: RE:

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


@AlgoCreators

AlgoCreators
11 Apr 2023, 15:58

RE:

PanagiotisChar said:

Hi there, 

Here you go

            var bars = MarketData.GetBars(TimeFrame.Daily);
            _adx = Indicators.AverageTrueRange(bars, 10, MovingAverageType.Exponential);

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us

 

Thanks for the tip you posted but that's not what I meant!
I will explain again:
this is my custom indicator:
 

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.Indicators
{
    [Indicator(AccessRights = AccessRights.None, IsOverlay = false)]
    public class CandleSizeMoving : Indicator
    {

        [Parameter("Candle Period", DefaultValue = 3)]
        public int CandlePeriod { get; set; }


        [Parameter("Moving Period", Group = "Moving Average", DefaultValue = 200)]
        public int MAPeriod { get; set; }


        [Output("Main")]
        public IndicatorDataSeries Result { get; set; }
        [Output("small", LineColor = "Aqua")]
        public IndicatorDataSeries Moving { get; set; }
        private MovingAverage MA { get; set; }


        protected override void Initialize()
        {
            MA = Indicators.MovingAverage(Result, MAPeriod, MovingAverageType.Exponential);
        }

        public override void Calculate(int index)
        {
            double t_body = 0.0;
            for (int i = CandlePeriod; i > 0; i--)
                t_body += Math.Abs(Bars.HighPrices[index - i] - Bars.LowPrices[index - i]) / Symbol.PipSize;

            Result[index] = t_body / CandlePeriod;
            Moving[index] = MA.Result[index];
        }
    }
}

And I want my indicator to have the ability retrieve OHLCV data for multiple timeframes, like other indicators


@AlgoCreators

AlgoCreators
26 Jan 2023, 13:40

The connection is still unstable

Hi,The connection is still unstable and keeps disconnecting and reconnecting. This happens 100 times a day.
In our country, the speed of the Internet has been greatly reduced for some time. However, Metatrader has no connection problems.
How can this problem be solved?


@AlgoCreators

AlgoCreators
03 Aug 2022, 08:06 ( Updated at: 21 Dec 2023, 09:22 )

RE: maybe this can help you

paolo.panicali said:

// Month Separator by ppanicali2022//last 12 month  separator

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

namespace cAlgo
{
    [Indicator(IsOverlay = true, TimeZone = TimeZones.CentralEuropeanStandardTime, AccessRights = AccessRights.None)]
    public class MonthSeparator : Indicator
    {
        public override void Calculate(int index)
        {
            if (Bars.OpenTimes[index - 1].Month == Bars.OpenTimes[index].AddMonths(-1).Month && Bars.OpenTimes[index - 1] >= DateTime.Now.AddYears(-1))
            {
                Chart.DrawVerticalLine("MonthStart" + index, index, Color.Red);
                Chart.DrawText("MonthName" + index, DateTimeFormatInfo.CurrentInfo.GetAbbreviatedMonthName(Bars.OpenTimes[index].Month), index, Bars.ClosePrices[index], Color.Green);
            }
        }
    }
}

Thank you
Your code works fine
I myself came to the answer in a different way

Bars bars_D1 = MarketData.GetBars(TimeFrame.Daily, Symbol.Name);
                Color color = "#24FE00FD";
                for (int i = 0; i < 200; i++)
                {
                    if (bars_D1.Last(i).OpenTime.Month != bars_D1.Last(i+1).OpenTime.Month)
                    {
                        rect = Chart.DrawRectangle("Candle_D1" + bars_D1.Last(i).OpenTime, bars_D1.Last(i).OpenTime, bars_D1.Last(i).High, bars_D1.Last(0).OpenTime, bars_D1.Last(i).Low, color);
                        rect.Comment = "Candle_D1";
                        rect.IsInteractive = true;
                        rect.IsFilled = true;
                    }
                }

 


@AlgoCreators

AlgoCreators
04 Apr 2022, 09:03

RE:

amusleh said:

Hi,

You can't add/remove indicators on a chart with a cBot.

Thank you
Will these restrictions be lifted in the future? Because The answer to many of your users' questions is "you can not"!!!

Do not you want to expand the programming capabilities of this platform ??


@AlgoCreators

AlgoCreators
14 Mar 2022, 23:46

RE: RE: how to send messages to telegram channel?

amusleh said:

meeting.chegini said:

I want to send messages to a telegram channel
How can I do this?
Thanks

Hi,

You have to add the Telegram bot as an admin on your channel and then you will be able to get a chat ID with it that you can use it to send messages.

Here is a tutorial: Telegram · afhacker/ctrader-alert_popup Wiki (github.com)

Thank you
I also noticed that i can write channel name  instead of the chat ID


@AlgoCreators

AlgoCreators
14 Mar 2022, 05:16

how to send messages to telegram channel?

I want to send messages to a telegram channel
How can I do this?
Thanks


@AlgoCreators

AlgoCreators
05 Mar 2022, 01:22

use enumerations types

like this

        

public enum CustomType
        {
           Low,
           Medium,
           High
        }
        [Parameter("P1", Group = "new type", DefaultValue = Low)]
        public CustomType P1 { get; set; }

read this like for more information:https://w3schools.com/cs/cs_enums.php


@AlgoCreators

AlgoCreators
26 Feb 2022, 23:24

I feel that Project ctrader has been abandoned !!!


@AlgoCreators

AlgoCreators
08 Feb 2022, 09:10

How many requests can be sent per second?

Hello
thank you,The code works fine
But I want to be able to send a message every second
is this possible?


@AlgoCreators

AlgoCreators
05 Feb 2022, 09:06 ( Updated at: 21 Dec 2023, 09:22 )

RE:

meeting.chegini said:

hi

I want to access the past values of the stochastic, but these values are different from what the indicator shows

_stoc1 = Indicators.StochasticOscillator(9, 3, 9, MovingAverageType.Exponential);

Print(_stoc1.PercentK[1]); 

------------------------------------------

output: 32/8461386529739

 

The problem was solved!!!!

Print(_stoc1.PercentK.Last(1)); 

That's right


@AlgoCreators

AlgoCreators
02 Feb 2022, 02:36

I could not install!!!

Attempting to gather dependency information for package 'cAlgo.API.Alert.2.2.2' with respect to project 'New cBot (2)', targeting '.NETFramework,Version=v4.5'
Attempting to resolve dependencies for package 'cAlgo.API.Alert.2.2.2' with DependencyBehavior 'Lowest'
Resolving actions to install package 'cAlgo.API.Alert.2.2.2'
Resolved actions to install package 'cAlgo.API.Alert.2.2.2'
Adding package 'CommonServiceLocator.2.0.4' to folder 'C:\Users\parsin\Documents\cAlgo\Sources\Robots\New cBot (2)\packages'
Added package 'CommonServiceLocator.2.0.4' to folder 'C:\Users\parsin\Documents\cAlgo\Sources\Robots\New cBot (2)\packages'
Added package 'CommonServiceLocator.2.0.4' to 'packages.config'
Successfully installed 'CommonServiceLocator 2.0.4' to New cBot (2)
Adding package 'ControlzEx.3.0.2.4' to folder 'C:\Users\parsin\Documents\cAlgo\Sources\Robots\New cBot (2)\packages'
Added package 'ControlzEx.3.0.2.4' to folder 'C:\Users\parsin\Documents\cAlgo\Sources\Robots\New cBot (2)\packages'
Added package 'ControlzEx.3.0.2.4' to 'packages.config'
Successfully installed 'ControlzEx 3.0.2.4' to New cBot (2)
Adding package 'LiteDB.5.0.9' to folder 'C:\Users\parsin\Documents\cAlgo\Sources\Robots\New cBot (2)\packages'
Added package 'LiteDB.5.0.9' to folder 'C:\Users\parsin\Documents\cAlgo\Sources\Robots\New cBot (2)\packages'
Install failed. Rolling back...
Package 'LiteDB.5.0.9' does not exist in project 'New cBot (2)'
Removed package 'ControlzEx.3.0.2.4' from 'packages.config'
Removed package 'CommonServiceLocator.2.0.4' from 'packages.config'
Removing package 'LiteDB.5.0.9' from folder 'C:\Users\parsin\Documents\cAlgo\Sources\Robots\New cBot (2)\packages'
Removed package 'LiteDB.5.0.9' from folder 'C:\Users\parsin\Documents\cAlgo\Sources\Robots\New cBot (2)\packages'
Removing package 'ControlzEx.3.0.2.4' from folder 'C:\Users\parsin\Documents\cAlgo\Sources\Robots\New cBot (2)\packages'
Removed package 'ControlzEx.3.0.2.4' from folder 'C:\Users\parsin\Documents\cAlgo\Sources\Robots\New cBot (2)\packages'
Removing package 'CommonServiceLocator.2.0.4' from folder 'C:\Users\parsin\Documents\cAlgo\Sources\Robots\New cBot (2)\packages'
Removed package 'CommonServiceLocator.2.0.4' from folder 'C:\Users\parsin\Documents\cAlgo\Sources\Robots\New cBot (2)\packages'
Failed to add reference to 'System.Runtime'. Please make sure that it is in the Global Assembly Cache.
========== Finished ==========
please guide me!


@AlgoCreators

AlgoCreators
16 Jan 2022, 17:18

RE:

Spotware said:

Find and Replace will be added to the cAlgo editor.

Hasn't this feature been added to the app yet????????/


@AlgoCreators