PanagiotisCharalampous's avatar
PanagiotisCharalampous
30 follower(s) 0 following 1006 subscription(s)
Replies

PanagiotisCharalampous
11 Jan 2018, 14:58

Hi irmscher9,

The problem with your indicator was that you were not using the correct indexes for the h2 series. The GetIndexByExactTime() function allows you to get the index for a specified MarketSeries based purely on time, which is a common reference between MarketSeries of different timeframes. Let me know if my explanation helps you.

Best Regards,

Panagiotis 


@PanagiotisCharalampous

PanagiotisCharalampous
11 Jan 2018, 10:11

Hi irmscher9,

Can you please try the version below and let me know if it works for you?

using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;
namespace cAlgo.Indicators
{
    [Indicator("High Minus Low", IsOverlay = true, TimeZone = TimeZones.UTC, AutoRescale = false, AccessRights = AccessRights.None)]
    public class HighMinusLow : Indicator
    {
        [Output("Main", Color = Colors.Orange)]
        public IndicatorDataSeries Result { get; set; }

        [Parameter(DefaultValue = 14)]
        public int Periods { get; set; }

        [Output("Upper", Color = Colors.Aquamarine)]
        public IndicatorDataSeries Upper { get; set; }

        [Output("Lower", Color = Colors.Aquamarine)]
        public IndicatorDataSeries Lower { get; set; }

        private MarketSeries h2;


        protected override void Initialize()
        {
            h2 = MarketData.GetSeries(TimeFrame.Hour2);
            //ma5 = Indicators.MovingAverage(h2.Close Period, MovingAverageType.Triangular);
        }

        public override void Calculate(int index)
        {
            double open = h2.Open[h2.OpenTime.GetIndexByExactTime(MarketSeries.OpenTime[index])];
            double close = h2.Close[h2.OpenTime.GetIndexByExactTime(MarketSeries.OpenTime[index])];

            Upper[index] = open;
            Lower[index] = close;
        }
    }
}

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
11 Jan 2018, 09:44

Hi Drummond360,

Can you please post the full cBot code so that we can check it? Also let us know on which broker you run this cBot.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
11 Jan 2018, 09:40

Hi ogima.515@gmail.com,

Can you please send us a screenshot with the parameters you are trying to use?

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
09 Jan 2018, 14:59

Hi jalmir.coelho@gmail.com,

Have a look at History collection. You can loop through it and get all the necessary information of past trades.

Let me know if this helps you.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
08 Jan 2018, 11:44

Hi megha,

Can you please provide us with more information about your problem e.g. a screenshot or a video? Does it still happen was it something temporary?

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
08 Jan 2018, 11:11

Hi ngocnguyen.uon,

There is no built in way to do this but you can combine the two indicators in a custom one. See a code 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 = 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);
        }

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

Let me know if this helps

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
08 Jan 2018, 10:28 ( Updated at: 21 Dec 2023, 09:20 )

Hi jalmir.coelho@gmail.com,

cBots are built without source code by default. See image below

Therefore if you distribute your .calgo file and you have not use "Build with Source Code" option, then the code will not be available.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
08 Jan 2018, 10:10

Hi aronbara9,

Thanks for posting in our forum. You can listen to the Positions Opened and Closed events.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
08 Jan 2018, 10:00

Hi swingfish,

If you post your custom indicator then maybe somebody from the community could suggest a solution to your problem.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
05 Jan 2018, 17:25

Hi pooya.kadkhodaee,

We have started rolling out the new native mobile apps to brokers. However, because deployments are dependent on many factors, not all brokers will get the new apps at the same time. But hopefully all brokers should have the new apps soon.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
05 Jan 2018, 15:43

Hi megha,

Please try the solution described here.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
05 Jan 2018, 11:50

Hi Drummond360,

Indeed it should have been PipSize. I fixed the code. Can you try now please?

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
05 Jan 2018, 11:37

Hi swingfish,

The build in moving average indicators do not offer this functionality, You would need to develop a custom indicator. Why do you need such functionality?

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
05 Jan 2018, 10:31

Dear Trader,

Thanks for posting in our forum. Check this guide on how to reference custom indicators in cAlgo. Let me know if this helps.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
05 Jan 2018, 10:28

Hi DelTrader,

Depth of market is available in cAlgo. Check MarketData GetMarketDepth. Let me know if this helps.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
04 Jan 2018, 17:11

Hi Drummond360,

From what I see, then yes, it should work...

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
04 Jan 2018, 16:52

Hi Drummond360,

Thanks for the code. Can you please explain what is the purpose of the following line of code is

   if (order.StopLossPips == null)

From what I see you always specify a stop loss, therefore

 if (order.StopLossPips == null) 
    ModifyPendingOrder(order, targetPrice, order.StopLoss, order.TakeProfit, Server.Time.AddMinutes(Duration));              

will never execute.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
04 Jan 2018, 16:31

Hi tradingu,

Even though I cannot commit to this, hopefully yes.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
04 Jan 2018, 16:30

Hi ctid410629,

Can you provide us with the following information please?

  1. A demo cBot that reproduces the problem.

  2. Optimization settings that you use.

  3. A screenshot of the problem.

The above information will help us reproduce the problem.

Best Regards,

Panagiotis

 


@PanagiotisCharalampous