Topics
Replies

payment
22 Jun 2017, 17:26 ( Updated at: 21 Dec 2023, 09:20 )

RE: RE: RE: RE:

 

My bot may not seem viable in its present form, but I don't think your HFT bots are viable AT ALL.

They would work on demo accounts, like the ones you show on myfxbook, but not on real accounts, because you won't get faster than your broker, who is a HFT trader.

Even if it works mathematically (as I said your bot is good) in reality you won't be able to execute fast enough, which is why you have not posted any live account forward tests to prove it (myfxbook). As lousy as you think my bot is (which I think is not all that bad), at least the live account results match the demo accout results

How can you use cAlgo on HFT trading ? that is ludicrous

 

 

 

 

 

trend_meanreversion said:

payment said:

No I'm not arguing, I think your bot is great. By the way I've fixed mine now to have a more reasonable equity DD see attached - 100% in on e month if you've got the guts

 

 

 

 

trend_meanreversion said:

payment said:

Well let's see your most recent backtest of the DAX between May and June this year,

 

Yes look at how equity dropped to '0' in your bot mate, not mine :)

Also don't wish to encourage an argument here, but you can see demo run ( not just back-test for May & June ) -> https://www.myfxbook.com/members/TRMR/dax-hft/2059675

As i said before, Good Luck to your trading and thanks for your advice !

 

 

 

Just my 2 cents mate --> Your equity profile reflects too much leverage, try to limit that and DD should come under control. In its current form your bot doesn't seem feasible to a viable trading strategy but keep exploring & All the Best :)

 


@payment

payment
21 Jun 2017, 12:44

Bounce

 

Can anyone help me with this? it's quite basic and I'm surprised that there is no documentation anywhere for this simple query


@payment

payment
21 Jun 2017, 00:42

Check out this one

 

/algos/cbots/show/876


@payment

payment
20 Jun 2017, 17:46 ( Updated at: 21 Dec 2023, 09:20 )

RE: RE: RE: RE:

 

Ok, the graph looks similar to a mean reversion. If you were using a martingale breakout, it would have much higher spikes on your graph, so it can't be that. It must be a one sided regression.

 

 

trend_meanreversion said:

payment said:

 

Raphael,

This is just a hedging strategy which works as long as the pair is ranging. To be safe, I'd only use it on EURCHF because this one tends to come back to the original price eventually. I calculated it to bring in about 120% per year, but watch out, if things start to trend, it will empty an account.

 

Which pair is this for ? No doubt EURUSD will draw down equity too much espacially in May

 

 

 

 

 

 

 

 

raphael.mca@hotmail.com said:

trend_meanreversion said:

Finally something which is looking good to earn quick bucks !!.. ( Thanks to everyone who suggested that martingale isn't always a bad option )

New version of DAX_HFT released !!

From 21 Sep 2014 - 16 Aug 2016

Total Return : 550%

Max DD : 6.5% ( balance)

Max DD :  27.8% ( equity )

Return/DD(balance): 84:1 (approx)

Return/DD(Equity): 20:1 (approx)  [ So you can leverage according to your needs ]

 

My friend, I appreciate the work you do with your cBot's.

Is this the same image from this link?
/algos/cbots/show/1622

 

 

 

Not sure mate if you are talking to me or Raphael. It is my thread so i can tell you that this particular bot DAX_HFT is meant to be run only on DAX CFDs ( not on FX pairs ) and contrary to your observation/assumption is based on trend ( not mean-reversion) ! 
 

Cheers.

 


@payment

payment
20 Jun 2017, 16:58 ( Updated at: 21 Dec 2023, 09:20 )

RE: RE:

No I'm not arguing, I think your bot is great. By the way I've fixed mine now to have a more reasonable equity DD see attached - 100% in on e month if you've got the guts

 

 

 

 

trend_meanreversion said:

payment said:

Well let's see your most recent backtest of the DAX between May and June this year,

 

Yes look at how equity dropped to '0' in your bot mate, not mine :)

Also don't wish to encourage an argument here, but you can see demo run ( not just back-test for May & June ) -> https://www.myfxbook.com/members/TRMR/dax-hft/2059675

As i said before, Good Luck to your trading and thanks for your advice !

 

 


@payment

payment
20 Jun 2017, 16:31

Well let's see your most recent backtest of the DAX between May and June this year,


@payment

payment
20 Jun 2017, 16:28

Look at the way the equity drops to 0 as soon as the DAX trends. Good but risky


@payment

payment
20 Jun 2017, 16:26 ( Updated at: 21 Dec 2023, 09:20 )

I've already got the formula, but if the DAX starts trending like now, watch out !  It crashes


@payment

payment
20 Jun 2017, 16:15 ( Updated at: 21 Dec 2023, 09:20 )

RE: RE:

 

Raphael,

This is just a hedging strategy which works as long as the pair is ranging. To be safe, I'd only use it on EURCHF because this one tends to come back to the original price eventually. I calculated it to bring in about 120% per year, but watch out, if things start to trend, it will empty an account.

 

Which pair is this for ? No doubt EURUSD will draw down equity too much espacially in May

 

 

 

 

 

 

 

 

raphael.mca@hotmail.com said:

trend_meanreversion said:

Finally something which is looking good to earn quick bucks !!.. ( Thanks to everyone who suggested that martingale isn't always a bad option )

New version of DAX_HFT released !!

From 21 Sep 2014 - 16 Aug 2016

Total Return : 550%

Max DD : 6.5% ( balance)

Max DD :  27.8% ( equity )

Return/DD(balance): 84:1 (approx)

Return/DD(Equity): 20:1 (approx)  [ So you can leverage according to your needs ]

 

My friend, I appreciate the work you do with your cBot's.

Is this the same image from this link?
/algos/cbots/show/1622

 


@payment

payment
20 Jun 2017, 14:34

When you run this it gives you 3 values every tick

1. Distance between MA

2. Distance to SLOW MA

3. Distance to FAST MA

 

Just look under Log when you run it

 

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

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 TrendRobot : Robot
    {
        [Parameter("MA Type")]
        public MovingAverageType MAType { get; set; }

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

        [Parameter("Slow Periods", DefaultValue = 50)]
        public int SlowPeriods { get; set; }

        [Parameter("Fast Periods", DefaultValue = 5)]
        public int FastPeriods { get; set; }

        [Parameter(DefaultValue = 10000, MinValue = 0)]
        public int Volume { get; set; }

        private MovingAverage slowMa;
        private MovingAverage fastMa;
        private const string label = "Sample Trend Robot";

        public double distance = 0;
        public double distance1 = 0;
        public double distance2 = 0;


        protected override void OnStart()
        {
            fastMa = Indicators.MovingAverage(SourceSeries, FastPeriods, MAType);
            slowMa = Indicators.MovingAverage(SourceSeries, SlowPeriods, MAType);
        }

        protected override void OnTick()
        {
            var longPosition = Positions.Find(label, Symbol, TradeType.Buy);
            var shortPosition = Positions.Find(label, Symbol, TradeType.Sell);

            var currentSlowMa = slowMa.Result.Last(0);
            var currentFastMa = fastMa.Result.Last(0);
            var previousSlowMa = slowMa.Result.Last(1);
            var previousFastMa = fastMa.Result.Last(1);


            distance = Math.Round(Math.Abs((currentSlowMa - currentFastMa) / Symbol.PipSize));
            distance1 = Math.Round(Math.Abs((currentSlowMa - MarketSeries.Close.Last(0)) / Symbol.PipSize));
            distance2 = Math.Round(Math.Abs((currentFastMa - MarketSeries.Close.Last(0)) / Symbol.PipSize));


            Print("DISTANCE BETWEEN MA=" + distance + "\tSLOW=" + distance1 + "\tFAST=" + distance2);



            //Print(currentSlowMa);
            //Print(currentFastMa);

        }
    }
}


@payment

payment
20 Jun 2017, 14:20

Actually change the FAST to SLOW and SLOW TO FAST  then it's correct

 

Print("DISTANCE BETWEEN MA=" + distance + "\tSLOW=" + distance1 + "\tFAST=" + distance2);

 

 

Look under LOG when you run it and it will give you the distances every tick


@payment

payment
20 Jun 2017, 14:18

TRY THIS ONE I TESTED IT

 

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


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 TrendRobot : Robot
    {
        [Parameter("MA Type")]
        public MovingAverageType MAType { get; set; }

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

        [Parameter("Slow Periods", DefaultValue = 50)]
        public int SlowPeriods { get; set; }

        [Parameter("Fast Periods", DefaultValue = 5)]
        public int FastPeriods { get; set; }

        [Parameter(DefaultValue = 10000, MinValue = 0)]
        public int Volume { get; set; }

        private MovingAverage slowMa;
        private MovingAverage fastMa;
        private const string label = "Sample Trend Robot";

        public double distance = 0;
        public double distance1 = 0;
        public double distance2 = 0;


        protected override void OnStart()
        {
            fastMa = Indicators.MovingAverage(SourceSeries, FastPeriods, MAType);
            slowMa = Indicators.MovingAverage(SourceSeries, SlowPeriods, MAType);
        }

        protected override void OnTick()
        {
            var longPosition = Positions.Find(label, Symbol, TradeType.Buy);
            var shortPosition = Positions.Find(label, Symbol, TradeType.Sell);

            var currentSlowMa = slowMa.Result.Last(0);
            var currentFastMa = fastMa.Result.Last(0);
            var previousSlowMa = slowMa.Result.Last(1);
            var previousFastMa = fastMa.Result.Last(1);


            distance = Math.Round(Math.Abs((currentSlowMa - currentFastMa) / Symbol.PipSize));
            distance1 = Math.Round(Math.Abs((currentSlowMa - MarketSeries.Close.Last(0)) / Symbol.PipSize));
            distance2 = Math.Round(Math.Abs((currentFastMa - MarketSeries.Close.Last(0)) / Symbol.PipSize));


            Print("DISTANCE BETWEEN MA=" + distance + "\tFAST=" + distance1 + "\tSLOW=" + distance2);

            //Print(currentSlowMa);
            //Print(currentFastMa);

        }
    }
}


@payment

payment
20 Jun 2017, 13:18

HERE IS THE SAME CODE BELOW WITH THE BITS I'VE ADDED UNDERLINED:

 

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

 

 

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 SampleTrendRobot : Robot
    {
        [Parameter("MA Type")]
        public MovingAverageType MAType { get; set; }
 
        [Parameter()]
        public DataSeries SourceSeries { get; set; }
 
        [Parameter("Slow Periods", DefaultValue = 10)]
        public int SlowPeriods { get; set; }
 
        [Parameter("Fast Periods", DefaultValue = 5)]
        public int FastPeriods { get; set; }
 
        [Parameter(DefaultValue = 10000, MinValue = 0)]
        public int Volume { get; set; }
 
        private MovingAverage slowMa;
        private MovingAverage fastMa;
        private const string label = "Sample Trend Robot";
 
public double distance = 0;
public double distance1 = 0;
public double distance2 = 0;
 
        protected override void OnStart()
        {
            fastMa = Indicators.MovingAverage(SourceSeries, FastPeriods, MAType);
            slowMa = Indicators.MovingAverage(SourceSeries, SlowPeriods, MAType);
        }
 
        protected override void OnBar()
        {
            var longPosition = Positions.Find(label, Symbol, TradeType.Buy);
            var shortPosition = Positions.Find(label, Symbol, TradeType.Sell);
 
            var currentSlowMa = slowMa.Result.Last(0);
            var currentFastMa = fastMa.Result.Last(0);
            var previousSlowMa = slowMa.Result.Last(1);
            var previousFastMa = fastMa.Result.Last(1);
 
 
distance = Math.Abs((currentSlowMa - currentFastMa) / symbol.PipSize);
distance1 = Math.Abs((currentSlowMa - MarketSeries.Close.Last(0)) / symbol.PipSize);
distance2 = Math.Abs((currentFastMa - MarketSeries.Close.Last(0)) / symbol.PipSize);
 
 
Print(distance + " D1=" + distance1 + " D2=" + distance2);
 
            if (previousSlowMa > previousFastMa && currentSlowMa <= currentFastMa && longPosition == null)
            {
                if (shortPosition != null)
                    ClosePosition(shortPosition);
                ExecuteMarketOrder(TradeType.Buy, Symbol, Volume, label);
            }
            else if (previousSlowMa < previousFastMa && currentSlowMa >= currentFastMa && shortPosition == null)
            {
                if (longPosition != null)
                    ClosePosition(longPosition);
                ExecuteMarketOrder(TradeType.Sell, Symbol, Volume, label);
            }
        }
    }
}

@payment

payment
20 Jun 2017, 13:07

You can use this code to start with

/algos/cbots/show/8

 

 


@payment