I can guarantee you profit

Created at 29 Nov 2013, 21:27
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
GE

getbuen

Joined 29.11.2013

I can guarantee you profit
29 Nov 2013, 21:27


Hello evey one and sorry for my bad english but I will try . Can any one help to build roobot that will get you alot of money 

1 we will use simple movingaverage  period 20

2 macd croos over 

3 time 5 minutes

How it works 

When the macdis below  0 and the the macd cross below the signal and the market is below the 20 moving average we sell on the secound closing bar

Also we buy if the macd cross abovw the signal above the 0  we buy in the secound green closing bar 

Please can any one help me to make this roobots . I AM GAINING MONEY WITH THIS STRATEGY BUT SOMTIMES THE MARKET IS MOVING FASTER THAN ME 


@getbuen
Replies

getbuen
29 Nov 2013, 22:51 ( Updated at: 21 Dec 2023, 09:20 )

RE:

THIS IS AN EXAMPLE 

getbuen said:

Hello evey one and sorry for my bad english but I will try . Can any one help to build roobot that will get you alot of money 

1 we will use simple movingaverage  period 20

2 macd croos over 

3 time 5 minutes

How it works 

When the macdis below  0 and the the macd cross below the signal and the market is below the 20 moving average we sell on the secound closing bar

Also we buy if the macd cross abovw the signal above the 0  we buy in the secound green closing bar 

Please can any one help me to make this roobots . I AM GAINING MONEY WITH THIS STRATEGY BUT SOMTIMES THE MARKET IS MOVING FASTER THAN ME 

 


@getbuen

getbuen
29 Nov 2013, 22:58 ( Updated at: 21 Dec 2023, 09:20 )

RE: RE:

AGAIN SOME PROOFS

 


@getbuen

Old Account
30 Nov 2013, 01:03

Could you show a image og your history, so I can see how much money you make?


@Old Account

jeex
02 Dec 2013, 09:29

Sometimes an answer is best said in music...

http://www.youtube.com/watch?v=NGFToiLtXro

But just for the experiment, i'll build you that robot.  YOU will have to think about the exit strategie.


@jeex

jeex
02 Dec 2013, 11:54 ( Updated at: 21 Dec 2023, 09:20 )

Results, what a surprise...

Not surprising that life can't be this simple. The results with:

  • Zero Spread!
  • Zero Commission!
  • 5 pips  SL and TP

With higher SL and TP it got even worse. As sometimes there are over 5 trades losing, so martingale is out of the question. A better Exit strategy might make the results better. But the most important problems as always with these MacDonalds strategies are:

  • the big spikes have already occured when the robot steps in
  • there are many trade moments within the algo, where the human eye would know better

EURUSD

GBPJPY


@jeex

getbuen
02 Dec 2013, 15:44 ( Updated at: 21 Dec 2023, 09:20 )

RE: Results, what a surprise...

thanks for replying me and  about the strategy can you give me the code to try it and develop it  and I will reply the result to you 

jeex said:

Not surprising that life can't be this simple. The results with:

  • Zero Spread!
  • Zero Commission!
  • 5 pips  SL and TP

With higher SL and TP it got even worse. As sometimes there are over 5 trades losing, so martingale is out of the question. A better Exit strategy might make the results better. But the most important problems as always with these MacDonalds strategies are:

  • the big spikes have already occured when the robot steps in
  • there are many trade moments within the algo, where the human eye would know better

EURUSD

GBPJPY

 


@getbuen

jeex
02 Dec 2013, 16:48

http://ctdn.com/algos/robots/show/155

Sorry, i never share my bots or indicators. However you may try this one and alter it by adding a simple SMA 20

/algos/robots/show/155

 


@jeex

getbuen
02 Dec 2013, 16:50

RE: http://ctdn.com/algos/robots/show/155

:( I don't know how to make this out .if I know how to code this I wont have topic here 

jeex said:

Sorry, i never share my bots or indicators. However you may try this one and alter it by adding a simple SMA 20

/algos/robots/show/155

 

 


@getbuen

Old Account
02 Dec 2013, 19:50

// -------------------------------------------------------------------------------
//
//    This is a Template used as a guideline to build your own Robot. 
//
// -------------------------------------------------------------------------------

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

namespace cAlgo.Robots
{
    [Robot()]
    public class MacdBot : Robot
    {
        private MacdHistogram _macd;
        private Position _position;
        private SimpleMovingAverage SMA;

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

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

        [Parameter("SMA Period", DefaultValue = 20)]
        public int Periods { get; set; }

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



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

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


        protected override void OnStart()
        {
            SMA = Indicators.SimpleMovingAverage(Source, Periods);
            _macd = Indicators.MacdHistogram(LongCycle, ShortCycle, Period);

        }

        protected override void OnBar()
        {
            if (Trade.IsExecuting)
                return;

            bool isLongPositionOpen = _position != null && _position.TradeType == TradeType.Buy;
            bool isShortPositionOpen = _position != null && _position.TradeType == TradeType.Sell;
            if (SMA.Result.LastValue < Symbol.Ask)
                if (_macd.Histogram.LastValue > 0.0 && _macd.Signal.IsRising() && !isLongPositionOpen)
                {
                    ClosePosition();
                    Buy();
                }
            if (SMA.Result.LastValue > Symbol.Ask)
                if (_macd.Histogram.LastValue < 0.0 && _macd.Signal.IsFalling() && !isShortPositionOpen)
                {
                    ClosePosition();
                    Sell();
                }
        }
        private void ClosePosition()
        {
            if (_position != null)
            {
                Trade.Close(_position);
                _position = null;
            }
        }

        private void Buy()
        {
            Trade.CreateBuyMarketOrder(Symbol, Volume);
        }

        private void Sell()
        {
            Trade.CreateSellMarketOrder(Symbol, Volume);
        }

        protected override void OnPositionOpened(Position openedPosition)
        {
            _position = openedPosition;
        }

    }
}

 

Still doesn't seem very profitable


@Old Account

getbuen
02 Dec 2013, 21:24

RE:

I modified it and it is getting better and better but can you tell me if I want to add take profit and stop loss to this and I will give you a beautiful result 

MRSV said:

// -------------------------------------------------------------------------------
//
//    This is a Template used as a guideline to build your own Robot. 
//
// -------------------------------------------------------------------------------

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

namespace cAlgo.Robots
{
    [Robot()]
    public class MacdBot : Robot
    {
        private MacdHistogram _macd;
        private Position _position;
        private SimpleMovingAverage SMA;

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

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

        [Parameter("SMA Period", DefaultValue = 20)]
        public int Periods { get; set; }

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



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

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


        protected override void OnStart()
        {
            SMA = Indicators.SimpleMovingAverage(Source, Periods);
            _macd = Indicators.MacdHistogram(LongCycle, ShortCycle, Period);

        }

        protected override void OnBar()
        {
            if (Trade.IsExecuting)
                return;

            bool isLongPositionOpen = _position != null && _position.TradeType == TradeType.Buy;
            bool isShortPositionOpen = _position != null && _position.TradeType == TradeType.Sell;
            if (SMA.Result.LastValue < Symbol.Ask)
                if (_macd.Histogram.LastValue > 0.0 && _macd.Signal.IsRising() && !isLongPositionOpen)
                {
                    ClosePosition();
                    Buy();
                }
            if (SMA.Result.LastValue > Symbol.Ask)
                if (_macd.Histogram.LastValue < 0.0 && _macd.Signal.IsFalling() && !isShortPositionOpen)
                {
                    ClosePosition();
                    Sell();
                }
        }
        private void ClosePosition()
        {
            if (_position != null)
            {
                Trade.Close(_position);
                _position = null;
            }
        }

        private void Buy()
        {
            Trade.CreateBuyMarketOrder(Symbol, Volume);
        }

        private void Sell()
        {
            Trade.CreateSellMarketOrder(Symbol, Volume);
        }

        protected override void OnPositionOpened(Position openedPosition)
        {
            _position = openedPosition;
        }

    }
}

 

Still doesn't seem very profitable

 


@getbuen

jeex
02 Dec 2013, 22:54

Exit strategy

@getbuen Do you have a proper exit strategy when you trade manualy. Then you should robotize that strategy. Bad exits always cost more trades than bad entries.
 


@jeex

getbuen
02 Dec 2013, 23:04

RE: Exit strategy

jeex said:

@getbuen Do you have a proper exit strategy when you trade manualy. Then you should robotize that strategy. Bad exits always cost more trades than bad entries.
 

// -------------------------------------------------------------------------------
//
//    This is a Template used as a guideline to build your own Robot. 
//
// -------------------------------------------------------------------------------

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

namespace cAlgo.Robots
{
    [Robot()]
    public class MacdBot : Robot
    {
        private MacdHistogram _macd;
        private Position _position;
        private SimpleMovingAverage SMA;

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

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

        [Parameter("SMA Period", DefaultValue = 20)]
        public int Periods { get; set; }

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

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

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

        [Parameter("Stop Loss (pips)", DefaultValue = 100)]
        public int StopLoss { get; set; }

        [Parameter("Take Profit (pips)", DefaultValue = 100)]
        public int TakeProfit { get; set; }


        protected override void OnStart()
        {
            SMA = Indicators.SimpleMovingAverage(Source, Periods);
            _macd = Indicators.MacdHistogram(LongCycle, ShortCycle, Period);

        }

        protected override void OnBar()
        {
            if (Trade.IsExecuting)
                return;

            bool isLongPositionOpen = _position != null && _position.TradeType == TradeType.Buy;
            bool isShortPositionOpen = _position != null && _position.TradeType == TradeType.Sell;
            if (SMA.Result.LastValue < Symbol.Ask)
                if (_macd.Histogram.LastValue < 0.0005 && _macd.Signal.IsRising() && !isLongPositionOpen)
                {
                    ClosePosition();
                    Buy();
                }
            if (SMA.Result.LastValue > Symbol.Ask)
                if (_macd.Histogram.LastValue > 0.0005 && _macd.Signal.IsFalling() && !isShortPositionOpen)
                {
                    ClosePosition();
                    Sell();
                }
        }
        private void ClosePosition()
        {
            if (_position != null)
            {
                Trade.Close(_position);
                _position = null;
            }
        }

        private void Buy()
        {
            Trade.CreateBuyMarketOrder(Symbol, Volume);
        }

        private void Sell()
        {
            Trade.CreateSellMarketOrder(Symbol, Volume);
        }

        protected override void OnPositionOpened(Position openedPosition)
        {
            _position = openedPosition;

            double? stopLossPrice = null;
            double? takeProfitSize = null;

            if (StopLoss != 0)
            {
                if (openedPosition.TradeType == TradeType.Buy)
                {
                    stopLossPrice = openedPosition.EntryPrice - StopLoss * Symbol.PipSize;
                }
                else
                {
                    stopLossPrice = openedPosition.EntryPrice + StopLoss * Symbol.PipSize;
                }
            }

            if (TakeProfit != 0)
            {
                if (openedPosition.TradeType == TradeType.Buy)
                {
                    takeProfitSize = openedPosition.EntryPrice + TakeProfit * Symbol.PipSize;
                }
                else
                {
                    takeProfitSize = openedPosition.EntryPrice - TakeProfit * Symbol.PipSize;
                }
            }

            Trade.ModifyPosition(openedPosition, stopLossPrice, takeProfitSize);

        }

        ///
        /// Remove closed position from list
        ///

    }
}

 

try this one on 30 minutes chart and only work on EUR/USD  but even the result is good but it is not like what I want the key of this strategy is to enter on the second bar not the one which break the 20 moving average . but as you can see I played with this numbers and adjustment

  if (_macd.Histogram.LastValue < 0.0005 && _macd.Signal.IsRising() && !isLongPositionOpen)
                {
                    ClosePosition();
                    Buy();
                }
            if (SMA.Result.LastValue > Symbol.Ask)
                if (_macd.Histogram.LastValue > 0.0005 && _macd.Signal.IsFalling() && !isShortPositionOpen)
                {

if you can help please .... and I have many strategies that I can share with you if you want to make them  

 


@getbuen

getbuen
02 Dec 2013, 23:10 ( Updated at: 21 Dec 2023, 09:20 )

RE: RE: Exit strategy

 

 


@getbuen

Old Account
02 Dec 2013, 23:11 ( Updated at: 21 Dec 2023, 09:20 )

RE: RE: RE: Exit strategy

getbuen said:

 

 

Could you share you parameters whit me ?

 


@Old Account

Old Account
02 Dec 2013, 23:20

RE: RE: Exit strategy

I would be happy to help you as much i a can getbuen.

Here is my e-mail : MrSvensli@hotmail.no


@Old Account

getbuen
02 Dec 2013, 23:31

RE: RE: RE: Exit strategy

MRSV said:

I would be happy to help you as much i a can getbuen.

Here is my e-mail : MrSvensli@hotmail.no

thanks my friend 

1 we will use simple movingaverage  period 20

2 macd croosover 

How it works 

When the macdis below  0 and the the macd cross below the signal and the market is below the 20 moving average we sell on the second closing bar

Also we buy if the macd cross above the signal above the 0  we buy in the second green closing bar 

 

the most impotent thing in this strategy is the second closing bar  if the first bar went below the 20 moving average we will wait for the second bar to enter and most likely that bar will be the one to close the profit on  if you are scalper.

if you did not understand this I will try to provide you with pictures :) 

 

sorry for my bad English 


@getbuen

Old Account
02 Dec 2013, 23:37

RE: RE: RE: RE: Exit strategy

getbuen said:

MRSV said:

I would be happy to help you as much i a can getbuen.

Here is my e-mail : MrSvensli@hotmail.no

thanks my friend 

1 we will use simple movingaverage  period 20

2 macd croosover 

How it works 

When the macdis below  0 and the the macd cross below the signal and the market is below the 20 moving average we sell on the second closing bar

Also we buy if the macd cross above the signal above the 0  we buy in the second green closing bar 

 

the most impotent thing in this strategy is the second closing bar  if the first bar went below the 20 moving average we will wait for the second bar to enter and most likely that bar will be the one to close the profit on  if you are scalper.

if you did not understand this I will try to provide you with pictures :) 

 

sorry for my bad English 

I will try to code it, send me an email, so i get your email. I wil send you the finished code there


@Old Account

getbuen
02 Dec 2013, 23:47

RE: RE: RE: RE: RE: Exit strategy

oky I  sent you my email :)

MRSV said:

getbuen said:

MRSV said:

I would be happy to help you as much i a can getbuen.

Here is my e-mail : MrSvensli@hotmail.no

thanks my friend 

1 we will use simple movingaverage  period 20

2 macd croosover 

How it works 

When the macdis below  0 and the the macd cross below the signal and the market is below the 20 moving average we sell on the second closing bar

Also we buy if the macd cross above the signal above the 0  we buy in the second green closing bar 

 

the most impotent thing in this strategy is the second closing bar  if the first bar went below the 20 moving average we will wait for the second bar to enter and most likely that bar will be the one to close the profit on  if you are scalper.

if you did not understand this I will try to provide you with pictures :) 

 

sorry for my bad English 

I will try to code it, send me an email, so i get your email. I wil send you the finished code there

 


@getbuen