Nickachino's avatar
Nickachino
Nickachino's avatar

Info

Username:Nickachino
Name:Nickachino
Member since: 03 Apr 2017

About

None

Signature

None

Last Forum Posts

@Swing high code:  02 Sep 2021, 22:48


Hi,

Anyone that can help me code the following:

I want to store the last two swing highs and compare it to each other. A swing high is defined as a 3 bar high. For example if the candle high is higher than the previous three bar highs and higher than the next bar's high then it is regarded as a swing high. What I want is two have the last two swing high to compare them to each other to see if the last swing high is higher or lower than the previous one.

Below is a screen shot of the last two swing highs as defined above:

@cBot Trial:  30 Aug 2021, 15:48


PanagiotisCharalampous said:

Hi Nick,

You have two options

1) Hard code the expiration date in the cBot's code and exit the cBot in case the expiration date has passed.

2) Implement a licensing system that will control the trial period of your cBot.

See an example for point 1 below

            var dateTime = new DateTime(2021, 9, 30);
            if (Server.Time > dateTime)
                return;

Best Regards,

Panagiotis 

Join us on Telegram and Facebook

Thanks for the quick response.

I quickly were bale to implement the hardcoded style, however do you have any direction on how to go about implementing the licensing system?

@cBot Trial:  30 Aug 2021, 15:04


Hi,

Can anyone assist in helping how a trial version of a cBot can be created, that expires after 1 month's of use for example?

Regards

Nick

@Custom Indicator call error:  09 Aug 2021, 17:02


Hi,

I m trying to use 2 EMAs from a custom multi timeframe indicators. I get an error when I call the indicator in my cBot.

This is the indicator code:

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

namespace cAlgo.Indicators
{
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC)]
    public class MyMTFEMA : Indicator
    {
        [Parameter(DefaultValue = 8)]
        public int EMAPeriods1 { get; set; }

        [Parameter(DefaultValue = 21)]
        public int EMAPeriods2 { get; set; }

        [Parameter("EMA Timeframe1", DefaultValue = "Hour")]
        public TimeFrame EMATimeframe1 { get; set; }

        [Parameter("EMA Timeframe2", DefaultValue = "Hour")]
        public TimeFrame EMATimeframe2 { get; set; }

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

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

        private MarketSeries series1;
        private MarketSeries series2;

        private ExponentialMovingAverage Ema1;
        private ExponentialMovingAverage Ema2;

        protected override void Initialize()
        {
            series1 = MarketData.GetSeries(EMATimeframe1);
            series2 = MarketData.GetSeries(EMATimeframe2);

            Ema1 = Indicators.ExponentialMovingAverage(series1.Close, EMAPeriods1);
            Ema2 = Indicators.ExponentialMovingAverage(series2.Close, EMAPeriods2);

        }

        public override void Calculate(int index)
        {

            var index1 = GetIndexByDate(series1, MarketSeries.OpenTime[index]);
            if (index1 != -1)
            {
                EMA1[index] = Ema1.Result[index1];
            }

            var index2 = GetIndexByDate(series2, MarketSeries.OpenTime[index]);
            if (index2 != -1)
            {
                EMA2[index] = Ema2.Result[index2];
            }

        }


        private int GetIndexByDate(MarketSeries series, DateTime time)
        {
            for (int i = series.Close.Count - 1; i > 0; i--)
            {
                if (time == series.OpenTime[i])
                    return i;
            }
            return -1;
        }
    }
}

The I call it like this:

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

namespace cAlgo.Robots
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class SIMPLEandPROFITABLEForexScalping : Robot
    {
        [Parameter("Risk %", DefaultValue = 0.02)]
        public double RiskPct { get; set; }

        [Parameter("EMA1 period", DefaultValue = 8)]
        public int EMA1Period { get; set; }

        [Parameter("EMA2 period", DefaultValue = 13)]
        public int EMA2Period { get; set; }

        [Parameter("EMA3 period", DefaultValue = 21)]
        public int EMA3Period { get; set; }

        private MovingAverage EMA1;
        private MovingAverage EMA2;
        private MovingAverage EMA3;
        private MyMTFEMA MTFEMA;

        protected override void OnStart()
        {
            // Put your initialization logic here
            EMA1 = Indicators.MovingAverage(Bars.ClosePrices, EMA1Period, MovingAverageType.Exponential);
            EMA2 = Indicators.MovingAverage(Bars.ClosePrices, EMA2Period, MovingAverageType.Exponential);
            EMA3 = Indicators.MovingAverage(Bars.ClosePrices, EMA3Period, MovingAverageType.Exponential);
            MTFEMA = Indicators.GetIndicator<MyMTFEMA>(8, 21, "Hour", "Hour");
            
        }

However I get an error when trying to run the cBot with this message:

31/12/2019 02:00:00.000 | Backtesting started
31/12/2019 02:00:00.000 | Crashed in OnStart with AlgoActivationException: Can not set "Hour" as a value for "EMATimeframe1" parameter
31/12/2019 02:00:00.000 | Backtesting was stopped

I have tried various ways to change the way I call the parameters using the 8, 21 and two "Hour" options but still get an error.

Any assistance would be appreciated.
 

@Ability to run cAlgo on iPhone/iPad/Android Devices.:  17 Mar 2017, 07:05


Currently it is difficult to manage cBots as you run cAlgo from your computer at home but sometimes power trips or internet connectivity is interupted and your cbots gets cancelled. It would be much easier managing them if you can access them from your tablet or phone.

@CAlgo on tablets and phones.:  17 Mar 2017, 06:35


I agree that this would be a very usable feature. I would definitely use it. Common Spotware, work your magic.

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.
Alpha Trend Trader
  0
  0
  134
paid  31 Aug 2021
This trading bot uses cTrader as platform to trade on. It is a fully automated trading robot that employs a trend following strategy using pullbacks for entry. Stop losses and take profits are set automatically. Trades are opened and closed automatically. It employs advanced money management to enhance profits and the trading strategy employed has a definite edge on the markets. It trades the stock market (specifically stock indices) and has been optimized on the US500 and NASDAQ100 using tick data. Do not use this bot on other markets. You are welcome to explore other stock index markets and can optimize the parameters to get a good fit. This strategy should be traded on the daily timeframe. The strategy does not take a lot of trades but is very accurate when it does, meaning and increased risk per trade can be considered. Some simulated results: US500 - Starting capital 10 000 - 2% risked per trade - Results: +54% growth since June 2016 ( used all available data on my broker) with an max equity drawdown of 6.00%. Commissions included. When using 5% risk per trade the profits increase to 185% over this period, while the max equity drawdown increase to 14.93% showing profits increased more in relation to drawdown. NASDAQ100 - Starting capital 10 000 - 5% risked per trade - Results: 96% growth since Nov 2015 ( used all available data on my broker) with an max equity drawdown of 12.84%. Commissions included. When using 10% risk per trade the profits increase to 255% over this period, while the max equity drawdown increase to 25.74% showing profits increased more in relation to drawdown. The above is indicative of proper risk management being applied in this trading bot. The conservative trader can reduce capital risked per trade to still achieve awesome profits at reduced exposure / drawdown. Suggested set files included in purchase. See screen shots of simulated results below. US500_1 US500_2 US500_3 NASDAQ100_1 NASDAQ100_2 NASDAQ100_3   Demo version available upon request.   Use this bot at own risk and always do demo trading first before employing this bot on your live account!!!   The first 10 purchases of this robot will get a discount of 10% using the discount code profits100 !!!   Buy this bot at nickachino5.gumroad.com/l/wMIyS