khoshroomahdi's avatar
Mahdi
Mahdi 's avatar

Info

Username:khoshroomahdi
Name:Mahdi
Member since: 17 Jun 2021

About

None

Signature

None

Last Algorithm Comments

@Pattern Drawing:  22 Jun 2021, 20:12


why you didin't add this code to internal ctrader tools.? ex: Draw Traingle and fork is better than default tools

@Draw Spread:  18 Jun 2021, 16:54


Please add color parameter. enable $disable label, position on chart parameter

Last Forum Posts

@install nuget package withoug visual studio:  28 Aug 2021, 15:18


i try to use this project.i try to install nuget with vs code. i open the indicator folder that contains sln file and try to install nuget with terminal.but nothing happend. is there any way to install nuget with vscode or ctrader automate to install nuget packages.

in ctrader we could add dll file. is it possible to have this dll ?

i need macd alert indicator.

i think if upload an indicator sample with this nuget package would be great because every one could change that soources without visual studio.

@stochastic multitime:  12 Aug 2021, 22:04


amusleh said:

Hi,

Try this:

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

namespace cAlgo
{
    [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class AWMACDMTF : Indicator
    {
        private StochasticOscillator _stoch;

        private Bars _baseTimeFrameBars;

        // you could change default Value to Minute,Minute15,Hour2 and ...
        [Parameter("Base Timeframe", DefaultValue = "Minute15")]
        public TimeFrame BaseTimeFrame { get; set; }

        [Parameter("K%", DefaultValue = 5)]
        public int kPeriod { get; set; }

        [Parameter("K slowing", DefaultValue = 3)]
        public int kslowing { get; set; }

        [Parameter("D%", DefaultValue = 3)]
        public int dPeriod { get; set; }

        [Output("K%,", LineColor = "Red", LineStyle = LineStyle.Solid, Thickness = 2)]
        public IndicatorDataSeries k_Line { get; set; }

        [Output("D%,", LineColor = "Blue", LineStyle = LineStyle.Solid, Thickness = 2)]
        public IndicatorDataSeries d_Line { get; set; }

        protected override void Initialize()
        {
            _baseTimeFrameBars = MarketData.GetBars(BaseTimeFrame);

            _stoch = Indicators.StochasticOscillator(_baseTimeFrameBars, kPeriod, kslowing, dPeriod, MovingAverageType.Simple);
        }

        public override void Calculate(int index)
        {
            var baseSeriesIndex = _baseTimeFrameBars.OpenTimes.GetIndexByTime(Bars.OpenTimes[index]);
            k_Line[index] = _stoch.PercentK[baseSeriesIndex];
            d_Line[index] = _stoch.PercentD[baseSeriesIndex];
        }
    }
}

your code is like my code. i want indicotr be like the second  picture that i placed in first post.

@stochastic multitime:  12 Aug 2021, 09:07


i create stochastic mtf but i have a problem with that. the line is not that exact thing that i want. iuse below code and this make line number 1 picture. i wnat like be the secong picture.

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

namespace cAlgo
{
    [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class AWMACDMTF : Indicator
    {
        private StochasticOscillator _stoch;

        private Bars _baseTimeFrameBars;
        // you could change default Value to Minute,Minute15,Hour2 and ...
        [Parameter("Base Timeframe", DefaultValue = "Minute15")]
        public TimeFrame BaseTimeFrame { get; set; }

        [Parameter("K%", DefaultValue = 5)]
        public int kPeriod { get; set; }

        [Parameter("K slowing", DefaultValue = 3)]
        public int kslowing { get; set; }

        [Parameter("D%", DefaultValue = 3)]
        public int dPeriod { get; set; }


        [Output("K%,", LineColor = "Red", LineStyle = LineStyle.Solid, Thickness = 2)]
        public IndicatorDataSeries k_Line { get; set; }

        [Output("D%,", LineColor = "Blue", LineStyle = LineStyle.Solid, Thickness = 2)]
        public IndicatorDataSeries d_Line { get; set; }



        protected override void Initialize()
        {
            _baseTimeFrameBars = MarketData.GetBars(BaseTimeFrame);

//_baseTimeFrameBars.ClosePrices

            _stoch = Indicators.StochasticOscillator(Bars, kPeriod, kslowing, dPeriod, MovingAverageType.Simple);
        }

        public override void Calculate(int index)
        {
            var baseSeriesIndex = _baseTimeFrameBars.OpenTimes.GetIndexByTime(Bars.OpenTimes[index]);
            k_Line[index] = _stoch.PercentK[baseSeriesIndex];
            d_Line[index] = _stoch.PercentD[baseSeriesIndex];
        }


    }
}

my indicator 

i want to be like below picture.

@NumricUpdown control:  10 Aug 2021, 12:30


i got error when i want use windows.forms . i want to add numericupdown control

using System;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Threading;
using System.Windows.Forms;

namespace cAlgo
{
    [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class test6 : Indicator
    {
        [Parameter(DefaultValue = 0.0)]
        public double Parameter { get; set; }

        [Output("Main")]
        public IndicatorDataSeries Result { get; set; }

        private System.Windows.Forms.NumericUpDown numericMinute;




        protected override void Initialize()
        {
            // Initialize and create nested indicators
        }

        public override void Calculate(int index)
        {
            // Calculate value at specified index
            // Result[index] = ...
        }
    }
}

@fix max and min in indicator area:  08 Aug 2021, 16:22


i want to fix min and max indicator windwos. like metatrader.

for ex: in stochastic i want to have 0 and 100 even when i zoom chart. because when i zoom chart for exmaple indicator area max and min changed.

i try this code but nothing happend.

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

namespace cAlgo
{
    [Indicator(IsOverlay = false, AutoRescale = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class NewIndicator : Indicator
    {
        [Parameter(DefaultValue = 0.0)]
        public double Parameter { get; set; }

        [Output("RSI", Color = Colors.Blue)]
        public IndicatorDataSeries Result { get; set; }
        [Output("K", Color = Colors.Green)]
        public IndicatorDataSeries K { get; set; }
        [Output("D", Color = Colors.Red)]
        public IndicatorDataSeries D { get; set; }

        private RelativeStrengthIndex _rsi;
        private StochasticOscillator _stochasticOscillator;

        protected override void Initialize()
        {
            _rsi = Indicators.RelativeStrengthIndex(MarketSeries.High, 14);
            _stochasticOscillator = Indicators.StochasticOscillator(9, 3, 9, MovingAverageType.Simple);
            IndicatorArea.SetYRange(0, 100);

        }

        public override void Calculate(int index)
        {
            Result[index] = _rsi.Result[index];
            K[index] = _stochasticOscillator.PercentK[index];
            D[index] = _stochasticOscillator.PercentD[index];
            IndicatorArea.SetYRange(0, 100);
        }
    }
}

@change textbox position between indicatorarea and chart area:  02 Aug 2021, 16:43


PanagiotisCharalampous said:

Hi khoshroomahdi,

See an example below

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

namespace cAlgo
{
    [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class NewIndicator : Indicator
    {
        [Parameter(DefaultValue = true)]
        public bool ShowOnMain { get; set; }


        protected override void Initialize()
        {
            // Initialize and create nested indicators
        }

        public override void Calculate(int index)
        {
            if (ShowOnMain)
                Chart.DrawStaticText("Text", "Text", VerticalAlignment.Top, HorizontalAlignment.Right, Color.Red);
            else
                Chart.IndicatorAreas[0].DrawStaticText("Text", "Text", VerticalAlignment.Top, HorizontalAlignment.Right, Color.Red);

        }
    }
}

Best Regards,

Panagiotis 

Join us on Telegram and Facebook

thanks. great answer

@change textbox position between indicatorarea and chart area:  02 Aug 2021, 16:15


how can i get all windwos open in my chart?

i have daily net profit percent indicator. i want trader should change position of this between main chart and indicator areas.?

i need to add option in parameters to do that.

for ex: in below image trader could open daily profit indicator setting and move it to main chart or indicator area.

@is it a bug with plottype:  02 Aug 2021, 14:25


using cAlgo.API;
using cAlgo.API.Indicators;

namespace cAlgo
{
    [Levels(0)]
    [Indicator(IsOverlay = false, AccessRights = AccessRights.None)]
    public class MACDLine : Indicator
    {
        public MacdHistogram MacdHistogram;

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

        [Parameter("Long Cycle", DefaultValue = 26)]
        public int LongCycle { get; set; }

        [Parameter("Short Cycle", DefaultValue = 12)]
        public int ShortCycle { get; set; }

        [Parameter("Signal Periods", DefaultValue = 9)]
        public int Periods { get; set; }




        [Output("Macd Line Up", PlotType = PlotType.DiscontinuousLine, LineColor = "Green", Thickness = 2)]
        public IndicatorDataSeries MacdLineUp { get; set; }

        [Output("Macd Line Dn", PlotType = PlotType.DiscontinuousLine, LineColor = "Red", Thickness = 2)]
        public IndicatorDataSeries MacdLineDn { get; set; }



        bool Mode;


        protected override void Initialize()
        {
            MacdHistogram = Indicators.MacdHistogram(Source, LongCycle, ShortCycle, Periods);
        }

        public override void Calculate(int index)
        {
            if (MacdHistogram.Histogram[index] >= MacdHistogram.Signal[index])
            {

                MacdLineUp[index] = MacdHistogram.Histogram[index];
                if (Mode == true)
                {
                    MacdLineUp[index - 1] = MacdHistogram.Histogram[index - 1];
                    Mode = false;
                }
            }

            else
            {
                MacdLineDn[index] = MacdHistogram.Histogram[index];
                if (Mode == false)
                {
                    MacdLineDn[index - 1] = MacdHistogram.Histogram[index - 1];
                    Mode = true;
                }

            }


        }
    }
}

@Ctrl + Z:  29 Jul 2021, 19:52


michaelrepsis98 said:

This is much needed. 

 i need to

@remove space between DiscontinuousLine:  29 Jul 2021, 19:51


i use DiscontinuousLine for two color line. but betwwen this line has spaced and i don't want this space.

i suggest to remove this spaced or add new plottype to have one continuousLine line without spaces.

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.
AW Moving Cloud
  0
  0
  36
free  21 Sep 2021
 moving average cloud. unfortunatly in ctrader we can not add cloud color parameter in interface.if you want to change color you have to change the code.     [Cloud("Fast MA", "Slow MA", FirstColor = "Green", Opacity = 0.5, SecondColor = "Red")]  
AW Macd Color
  0
  0
  272
free  28 Jul 2021
MACD Default Color like AWESOME OSCILLATOR (AO)  
AW Coral
  0
  0
  276
free  16 Jul 2021
Coral indicator
AW Multi Data
  0
  0
  205
free  09 Sep 2021
show symbol and time fram, daily net profit percent, daily net profit, and spread ln your chart. consider that timezone set to utc to show daily proift correctly.      
AW Spread
  0
  0
  375
free  15 Jul 2021
show spread on chart    
AW Moving MTF
  0
  0
  237
free  15 Jul 2021
multi time frame moving averge. you could choose different type of price like median ,high and ... and differnt type of moving average. you could shift moving in this indicator.    
AW Moving Average
  0
  0
  381
free  28 Jun 2021
 this moving include everything that a trader needs from Moving Average. PriceType: Open,Close,High,Low, Median,Typical,Weighted Support all moving average type.      
AW Vline
  0
  0
  308
free  25 Jun 2021
don't move to the end of chart after timeframe changing. it should be better to use for near history. for long history this have delay.
Warning! Executing cBots downloaded from this section may result in loss of funds. Use them at your own risk.
AW CP Step
  0
  0
  166
free  20 Aug 2021
this bot close all position and cancel all order after get step profit percent. step calculate by ((equity/balance)-1)*100
AW CP Daily
  0
  0
  221
free  20 Aug 2021
AW Close Position. this bot close all position and cancel all order after get daily profit percent.