Category Trend  Published on 18/01/2018

Hedging and Scalping cBot

Description

A simple cBot that uses hedging ans scalping.

Notes

  • Can make you nice profits in consolidating markets.
  • It can blow your account in trending markets.
  • Use always in context. 
  • Volume intensive. Use brokers with low commisions and tight spreads for better results.
  • Use at your own risk

Backtesting based on EURUSD and h1 for last two years in which EURUSD are in a rather consolidating state.


// -------------------------------------------------------------------------------------------------
//
//    This code is a cAlgo API sample.
//
//    This cBot is intended to be used as a sample and does not guarantee any particular outcome or
//    profit of any kind. Use it at your own risk
//
//    The "Sample Martingale cBot" creates a random Sell or Buy order. If the Stop loss is hit, a new 
//    order of the same type (Buy / Sell) is created with double the Initial Volume amount. The cBot will 
//    continue to double the volume amount for  all orders created until one of them hits the take Profit. 
//    After a Take Profit is hit, a new random Buy or Sell order is created with the Initial Volume amount.
//
// -------------------------------------------------------------------------------------------------

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

namespace cAlgo
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class HedgingandScalpingAlgo : Robot
    {


        [Parameter("Volume", DefaultValue = 1000, MinValue = 1000, Step = 1000)]
        public int Volume { get; set; }
        protected override void OnStart()
        {

        }
        protected override void OnBar()
        {
            ExecuteMarketOrder(TradeType.Buy, Symbol, Volume, "BUY");
            ExecuteMarketOrder(TradeType.Sell, Symbol, Volume, "SELL");
            foreach (var position in Positions)
            {
                if (position.Pips > 2)
                {
                    ClosePosition(position);
                }
            }
        }

    }


}



SK
skoutz.rothchild

Joined on 13.03.2017

  • Distribution: Free
  • Language: C#
  • Trading platform: cTrader Automate
  • File name: Hedging and Scalping Algo.algo
  • Rating: 0
  • Installs: 6623
  • Modified: 13/10/2021 09:54
Comments
Log in to add a comment.
GU
guillermo · 4 years ago

Don't use this robot with real money. It will eventually blow your account.

SI
siraj.farhan12 · 5 years ago

It's fake. It increases total balance by closing on the profits never worries about the losses. If you check equity it's always in loss.

ricky.global9's avatar
ricky.global9 · 5 years ago

Good to play game with...

Symposium's avatar
Symposium · 6 years ago

"Experts in cbots, rack your brains and inform if this cbot is a miracle or a fake one !!!

For investment of 10K, net profit is 75,168 with zero loss  !!!"

Not quite on Expert... But this cBot works perfectly... just check your drawdown and leveage amounts while the bot is running...... these will both be very high....

If you let the cBot run long enough in a ranging market it will more than cover the drawdown.... in tests I have run, 24 hours appears to be sufficent ( USDCAD T5 Chart)

Its software like this that has the FX industry pushing the regulators to cut leverage ratios and outlaw hedging.

Brokers cannot protect themselves against their own system if you use against them....

 

IA
IandelMar · 6 years ago

Hi, im backtesting with 0.01 and 0.05 PIPS but its the same Profit? can you please ad Stop Loss? Its also possible to make a max trade pairs? Thanks a lot

FX
fxprotrade18 · 6 years ago

Experts in cbots i have a challenge for you !!!

I have backtested "Hedging and Scalping cBot" for the period 01/04/2011 to 13/07/2018 for GBPUSD @ 1 HR time frame.  The most startling revelation i could draw from the backtest result is there is not even a single losing trade during this period. 

Experts in cbots, rack your brains and inform if this cbot is a miracle or a fake one !!!

For investment of 10K, net profit is 75,168 with zero loss  !!!

 

 

AB
abbe.charvat@gmail.com · 6 years ago
Ahoj , obchodujes jeste?
SM
SML2018 · 6 years ago

Hi,

Have you ever run a robot on a live account or demo account?

Looking forward your answer.

Best

SML

P.
p.thaisup · 6 years ago

It alot of Drowdown 100%
if we can make minimum just 20-30% it could be run on real account soon.

P.
p.thaisup · 6 years ago

Some one can help me add stop lost in this robot, I try to add this codes but it doesn't work

// -------------------------------------------------------------------------------------------------
//
//    This code is a cAlgo API sample.
//
//    This cBot is intended to be used as a sample and does not guarantee any particular outcome or
//    profit of any kind. Use it at your own risk
//
//    The "Sample Martingale cBot" creates a random Sell or Buy order. If the Stop loss is hit, a new 
//    order of the same type (Buy / Sell) is created with double the Initial Volume amount. The cBot will 
//    continue to double the volume amount for  all orders created until one of them hits the take Profit. 
//    After a Take Profit is hit, a new random Buy or Sell order is created with the Initial Volume amount.
//
// -------------------------------------------------------------------------------------------------

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

namespace cAlgo
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class HedgingandScalpingAlgo : Robot
    {

        [Parameter("Stop Loss", DefaultValue = 10)]
        public int StopLoss { get; set; }
        protected override void OnStart()
        {

        [Parameter("Volume", DefaultValue = 1000, MinValue = 1000, Step = 1000)]
        public int Volume { get; set; }
        protected override void OnStart()
        {

        }
        protected override void OnBar()
        {
            ExecuteMarketOrder(TradeType.Buy, Symbol, Volume,StopLoss ,0, "BUY");
            ExecuteMarketOrder(TradeType.Sell, Symbol, Volume,StopLoss ,0,0 "SELL");
            foreach (var position in Positions)
            {
                if (position.Pips > 2)
                {
                    ClosePosition(position);
                }
            }
        }

    }
}

MU
muhammedusyy · 6 years ago

am using it in a 5 minute time frame and works so much better

MU
muhammedusyy · 6 years ago

got to give u credit for this. amazing algo really is. gonna tkae it to real account soon

CT
ctid357966 · 7 years ago

When Hedging and Scalping cBot close loss position? Where stop-loss?

AG
agapitoharmony · 7 years ago

Hi cant see this on my ctrader account, Indicators - Custom. Any workaround for this, thank you. Tested on cAlgo but cant be seen on cTrader.

 

SK
skoutz.rothchild · 7 years ago

Hi,

In which timeframe to you trade? Positions close on bar change

YO
yosifov · 7 years ago

hi,

if (position.Pips > 2) doesnt seems to work correct .... I have position already 15 pips in profit, but the cBot doesnt close the the position. why?

NI
nilesh400@gmail.com · 7 years ago

Hi, seems to take up 20+ positions at a time. What is the max it will take on?

Also - what are your stop loss limits?  and how do you stop them all?

SK
skoutz.rothchild · 7 years ago

Profit is taken when a position earns more than 2 pips

BO
boyrayza · 7 years ago

hi . when it TP for Order? EA. or User ? i Dont see in code to Take Profit. ?

Thank you ^ ^