aysos75's avatar
abdalah hacid
Voir les choses du point de vue des choses elles mêmes.
abdalah hacid's avatar

Info

Username:aysos75
Name:abdalah hacid
Member since: 28 Sep 2013
Country:France

Favorite symbols:

GBPUSD

About

Je suis développeur Dotnet et j'adore le trading algorithmique. Je travaille avec Visual studio et j'écris une librairie cAlgo.Lib. https://github.com/abhacid/cAlgoBot

Signature

Voir les choses du point de vue des choses elles mêmes.

Last Algorithm Comments

@El Conejo - Scalper:  11 Sep 2015, 14:53


Thank's for your bot,

In line 184 I think the trailing stop is not set correctly  for a sell position :

before :                 double newStopLossPrice = Symbol.Ask + TrailingStop * Symbol.PipSize;

after :                 double newStopLossPrice = Symbol.Ask - TrailingStop * Symbol.PipSize;

 

 

@martingale with SL and MM:  11 Sep 2015, 14:36


If you want to compile the bot, you have to download the source on github and to read the explanations on https://github.com/abhacid/Martingale_Forex

@La Tortuga V0.5:  11 Sep 2015, 14:23


I have tested your bot, but he take no positions.

 

Can you make a snapshot with all your parameters ?

 

@ZigZag on multiple TimeFrames:  17 Jul 2015, 15:43


Very good job!

@martingale with SL and MM:  17 Jul 2015, 15:26


sorry for the two precedents mistakes

 

link to myfxbook : http://www.myfxbook.com/members/abhacid/mforex-1700/1304163

@martingale with SL and MM:  17 Jul 2015, 15:24


the new link to myfxbook statistique about martingale forex 1.7.0.0

is here

@martingale with SL and MM:  17 Jul 2015, 15:21


the new link to myfxbook statistique about martingale forex 1.7.0.0 is here

@martingale with SL and MM:  17 Jul 2015, 15:19


You can find Candlestick Tendency II here :

link to Candlestick Tendency II

Read the information about installation here

 

@Mechanic:  08 Jul 2015, 11:10


I have make a backtest with good result :

params :

[ChartParameters]
Symbol = EURUSD
Timeframe = m1

[cBotParameters]
HighOrderTimeFrame = Hour
Volume = 10000
EnableStopLoss = True
StopLoss = 69
EnableBreakEven = False
BreakEvenPips = 10
BreakEvenGain = 20
EnableTrailingStop = False
TrailingStop = 10
TrailingStart = 10
EnableTakeProfit = True
TakeProfit = 5
EnterOnSyncSignalOnly = False
ExitOnOppositeSignal = True

The result between 1/05/2015 and 06/07/2015 is 

+ 12465 euros (2571 trades and 2039 winnings trades)

The tendancy Candle is a good direction to search a profitable signal

Thanks to igorkroitor for this good bot.

@Mechanic:  08 Jul 2015, 09:35


Hello there

In code there is no difference between 

UpdateTrailingStop 

and

MoveToBreakEven

@MCAD PrbSAR noise:  05 Jul 2015, 15:34


I think tere is an error here in the code :

if (pos != null)

return pos.Commissions;

var po = PendingOrders.__Find("FxProQuant_" + magicIndex.ToString("F0"), symbol);

return po == null ? 0 : pos.Commissions;

if (pos==null) and (po !=null) then pos.Commissions doesn't have a value !

@MCAD PrbSAR noise:  05 Jul 2015, 14:55


Your bot is interesting, can you explain some of the idee Under this EA ?

@Golden Dragon II:  04 Jul 2015, 23:07


I have make a backtest on XAUUSD M5 (with bar from server and commission 30 per million) the results is good but drawdown very high.

@Pullback:  04 Jul 2015, 08:35


You can download all code on github

@Pullback:  03 Jul 2015, 10:37


Ok thanks

Is a good idea to test-it in real mode, you can also make-it on myfxbook for statistiques.

@Pullback:  02 Jul 2015, 17:00


can you take informations on

instrument to trade

Timeframe to use

Parameters to use

in order to test the bot

Thanks

@Kaufman Adaptative Moving Average:  30 Jun 2015, 20:46


@MZen

Close.fold((acc, previewClose, close) => acc + Math.Abs(close - previewClose), (double)0, +1, index - period, index);

is an anonyme method, with abstract type, the definition is in the cAlgo.Lib (file DataSeriesExtensions).

 The fold method traverses the list by applying an operator to "compress" into a single value. here he make the sum of (close(i)-previewClose(i)).

@martingale with SL and MM:  29 Jun 2015, 20:27


@8081871

Hello,

To compile the program must retrieve the bookstore on github and also the latest Martingale_Forex.

I made a Video explains how.

You can view the result in myfxbook, or in cMirror

Best Regards

 

@ZigZag Kwan MBFX Timing:  27 Jun 2015, 11:15


this is ok now

@martingale with SL and MM:  27 Jun 2015, 10:34


the first link don't work clic on the second link

 

 

@martingale with SL and MM:  27 Jun 2015, 09:07


I made a Youtube video in french to explain how to get the Visual Studio solution from Github and how to edit and debug the robot in conjunction with cAlgo.

J'ai fait une vidéo Youtube en français pour expliquer comment récupérer la solution Visual studio à partir de Github et comment modifier et déboguer le robot en liaison avec cAlgo.

@martingale with SL and MM:  24 Jun 2015, 21:00


yes I have updated it

@martingale with SL and MM:  23 Jun 2015, 01:00


By the weekend I would make an instructional video to make everything work between cTDN, Github and visual studio.

Basically everything is explained on github with settings files and screenshots in a specific folder of the Visual Studio solution. The robot runs on cMiror and can be replicated on one of your demo accounts

 

@martingale with SL and MM:  23 Jun 2015, 00:52


@hichem

Yes the screenshot refers to an early version since evolved program. for the latest version must be recovered on github.
It is in the 1.3.3.1 release.

@martingale with SL and MM:  23 Jun 2015, 00:47


the new copy trading reference is

https://cm.spotware.com/strategy/56298

@martingale with SL and MM:  21 Jun 2015, 13:42


I put on Martingale_Forex on CMiror:

https://cm.spotware.com/strategy/56296

it copies the positions he takes on either a demo account is a real account.

@martingale with SL and MM:  21 Jun 2015, 13:41


I put on Martingale_Forex on CMiror:

https://cm.spotware.com/strategy/56296

it copies the positions he takes on either a demo account is a real account.

 

@martingale with SL and MM:  20 Jun 2015, 21:45


the project is under github and the stats is here

@Alembex:  20 Jun 2015, 19:16


J'ai regardé le code, c'est plus une martingale qu'un money-management.

Le robot reprends le même volume à chaque fois qu'il perd et lorsqu'il gagne il prend un volume égal à l'ensemble de ses pertes depuis le dernier gain.

 

@RSI & Boll Bands w Threshold activation:  20 Jun 2015, 19:03


Why you don't precise the result of the bot with the parameters, the symbol and the timeframe ?

A bot without parameters, symbol and timeframe is incomplete!

@Golden Dragon II:  18 Jun 2015, 23:29


What parameters to use? with what timeframe and what symbol?

@Robot_Forex:  16 Jun 2015, 15:18


The statistic of the new version is here :

 

 

@Robot_Forex:  14 Jun 2015, 23:24


Le projet modifié se trouve sur github, il peut être récupéré directement dans visual studio avec les outils intégrés à vs2013 de gestion de versionning de code sources

The modified project is on github, it can be recovered directly into visual studio with the tools built into source code versioning management in vs2013

@Robot_Forex:  14 Jun 2015, 22:18


Voici le programme Robot_Forex avec l'ajout d'un stop Loss et la correction des méthodes obsolètes :

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

namespace cAlgo.Robots
{
    [Robot("Robot Forex", AccessRights = AccessRights.None)]
    public class Robot_Forex : Robot
    {
        [Parameter(DefaultValue = 10000, MinValue = 1000)]
        public int FirstLot { get; set; }

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

        //[Parameter(DefaultValue = 300)]
        //public int PipStep { get; set; }

        [Parameter("Stop_Loss", DefaultValue = 50, MinValue = 0)]
        public int Stop_Loss { get; set; }

        [Parameter("Take_Profit", DefaultValue = 180, MinValue = 10)]
        public int TakeProfit { get; set; }

        [Parameter("Tral_Start", DefaultValue = 50, MinValue = 10)]
        public int Tral_Start { get; set; }

        [Parameter("Tral_Stop", DefaultValue = 50, MinValue = 10)]
        public int Tral_Stop { get; set; }

 


        [Parameter(DefaultValue = 5, MinValue = 2)]
        public int MaxOrders { get; set; }

        private Position position;
        private bool RobotStopped;
        private string botLabel;


        protected override void OnStart()
        {
            botLabel = ToString();

            // The stop loss must be greater than tral stop
            //Stop_Loss = Math.Max(Tral_Stop, Stop_Loss);

            Positions.Opened += OnPositionOpened;
        }

        protected override void OnTick()
        {
            double Bid = Symbol.Bid;
            double Ask = Symbol.Ask;
            double Point = Symbol.TickSize;

            if (Trade.IsExecuting)
                return;

            if (Positions.Count > 0 && RobotStopped)
                return;
            else
                RobotStopped = false;

            if (Positions.Count == 0)
                SendFirstOrder(FirstLot);
            else
                ControlSeries();

            foreach (var position in Positions)
            {
                if (position.SymbolCode == Symbol.Code)
                {

                    if (position.TradeType == TradeType.Buy)
                    {
                        if (Bid - GetAveragePrice(TradeType.Buy) >= Tral_Start * Point)
                            if (Bid - Tral_Stop * Point >= position.StopLoss)
                                ModifyPosition(position, Bid - Tral_Stop * Point, position.TakeProfit);
                    }

                    if (position.TradeType == TradeType.Sell)
                    {
                        if (GetAveragePrice(TradeType.Sell) - Ask >= Tral_Start * Point)
                            if (Ask + Tral_Stop * Point <= position.StopLoss || position.StopLoss == 0)
                                ModifyPosition(position, Ask + Tral_Stop * Point, position.TakeProfit);
                    }
                }
            }
        }

        protected override void OnError(Error CodeOfError)
        {
            if (CodeOfError.Code == ErrorCode.NoMoney)
            {
                RobotStopped = true;
                Print("ERROR!!! No money for order open, robot is stopped!");
            }
            else if (CodeOfError.Code == ErrorCode.BadVolume)
            {
                RobotStopped = true;
                Print("ERROR!!! Bad volume for order open, robot is stopped!");
            }
        }

        private void SendFirstOrder(int OrderVolume)
        {
            int Signal = GetStdIlanSignal();
            if (!(Signal < 0))
                switch (Signal)
                {
                    case 0:
                        ExecuteMarketOrder(TradeType.Buy, Symbol, OrderVolume, botLabel);
                        break;
                    case 1:
                        ExecuteMarketOrder(TradeType.Sell, Symbol, OrderVolume, botLabel);
                        break;
                }
        }

        private void OnPositionOpened(PositionOpenedEventArgs args)
        {
            double? StopLossPrice = null;
            double? TakeProfitPrice = null;

            if (Positions.Count == 1)
            {
                position = args.Position;

                if (position.TradeType == TradeType.Buy)
                    TakeProfitPrice = position.EntryPrice + TakeProfit * Symbol.TickSize;
                if (position.TradeType == TradeType.Sell)
                    TakeProfitPrice = position.EntryPrice - TakeProfit * Symbol.TickSize;
            }
            else
                switch (GetPositionsSide())
                {
                    case 0:
                        TakeProfitPrice = GetAveragePrice(TradeType.Buy) + TakeProfit * Symbol.TickSize;
                        break;
                    case 1:
                        TakeProfitPrice = GetAveragePrice(TradeType.Sell) - TakeProfit * Symbol.TickSize;
                        break;
                }

            for (int i = 0; i < Positions.Count; i++)
            {
                position = Positions[i];
                if (StopLossPrice != null || TakeProfitPrice != null)
                    ModifyPosition(position, position.StopLoss, TakeProfitPrice);
            }
        }

        private double GetAveragePrice(TradeType TypeOfTrade)
        {
            double Result = Symbol.Bid;
            double AveragePrice = 0;
            long Count = 0;

            for (int i = 0; i < Positions.Count; i++)
            {
                position = Positions[i];
                if (position.TradeType == TypeOfTrade)
                {
                    AveragePrice += position.EntryPrice * position.Volume;
                    Count += position.Volume;
                }
            }
            if (AveragePrice > 0 && Count > 0)
                Result = AveragePrice / Count;
            return Result;
        }

        private int GetPositionsSide()
        {
            int Result = -1;
            int i, BuySide = 0, SellSide = 0;

            for (i = 0; i < Positions.Count; i++)
            {
                if (Positions[i].TradeType == TradeType.Buy)
                    BuySide++;
                if (Positions[i].TradeType == TradeType.Sell)
                    SellSide++;
            }
            if (BuySide == Positions.Count)
                Result = 0;
            if (SellSide == Positions.Count)
                Result = 1;
            return Result;
        }

        /// <summary>
        /// The gradient variable is a dynamic value that represente an equidistant grid between
        /// the high value and the low value of price.
        /// </summary>
        /// 
        private void ControlSeries()
        {
            const int BarCount = 25;
            int gradient = MaxOrders - 1;

            foreach (Position position in Positions.FindAll(botLabel, Symbol))
            {
                if (-position.Pips > Stop_Loss)
                    ClosePosition(position);

            }

            //if (PipStep == 0)
            int _pipstep = GetDynamicPipstep(BarCount, gradient);
            //else
            //    _pipstep = PipStep;

            if (Positions.Count < MaxOrders)
            {
                //int rem;
                long NewVolume = Symbol.NormalizeVolume(FirstLot + FirstLot * Positions.Count, RoundingMode.ToNearest);
                int positionSide = GetPositionsSide();

                switch (positionSide)
                {
                    case 0:
                        if (Symbol.Ask < FindLastPrice(TradeType.Buy) - _pipstep * Symbol.TickSize)
                        {
                            //NewVolume = Math.DivRem((int)(FirstLot + FirstLot * Positions.Count), LotStep, out rem) * LotStep;

                            if (NewVolume >= LotStep)
                                ExecuteMarketOrder(TradeType.Buy, Symbol, NewVolume, botLabel);
                        }
                        break;

                    case 1:
                        if (Symbol.Bid > FindLastPrice(TradeType.Sell) + _pipstep * Symbol.TickSize)
                        {
                            //NewVolume = Math.DivRem((int)(FirstLot + FirstLot * Positions.Count), LotStep, out rem) * LotStep;

                            if (NewVolume >= LotStep)
                                ExecuteMarketOrder(TradeType.Sell, Symbol, NewVolume, botLabel);
                        }
                        break;
                }
            }

        }

        private int GetDynamicPipstep(int CountOfBars, int gradient)
        {
            int Result;
            double HighestPrice = 0, LowestPrice = 0;
            int StartBar = MarketSeries.Close.Count - 2 - CountOfBars;
            int EndBar = MarketSeries.Close.Count - 2;

            for (int i = StartBar; i < EndBar; i++)
            {
                if (HighestPrice == 0 && LowestPrice == 0)
                {
                    HighestPrice = MarketSeries.High[i];
                    LowestPrice = MarketSeries.Low[i];
                    continue;
                }
                if (MarketSeries.High[i] > HighestPrice)
                    HighestPrice = MarketSeries.High[i];
                if (MarketSeries.Low[i] < LowestPrice)
                    LowestPrice = MarketSeries.Low[i];
            }

            Result = (int)((HighestPrice - LowestPrice) / Symbol.TickSize / gradient);

            return Result;
        }

        private double FindLastPrice(TradeType TypeOfTrade)
        {
            double LastPrice = 0;

            for (int i = 0; i < Positions.Count; i++)
            {
                position = Positions[i];
                if (TypeOfTrade == TradeType.Buy)
                    if (position.TradeType == TypeOfTrade)
                    {
                        if (LastPrice == 0)
                        {
                            LastPrice = position.EntryPrice;
                            continue;
                        }
                        if (position.EntryPrice < LastPrice)
                            LastPrice = position.EntryPrice;
                    }
                if (TypeOfTrade == TradeType.Sell)
                    if (position.TradeType == TypeOfTrade)
                    {
                        if (LastPrice == 0)
                        {
                            LastPrice = position.EntryPrice;
                            continue;
                        }
                        if (position.EntryPrice > LastPrice)
                            LastPrice = position.EntryPrice;
                    }
            }
            return LastPrice;
        }

        private int GetStdIlanSignal()
        {
            int Result = -1;
            int LastBarIndex = MarketSeries.Close.Count - 2;
            int PrevBarIndex = LastBarIndex - 1;

            if (MarketSeries.Close[LastBarIndex] > MarketSeries.Open[LastBarIndex])
                if (MarketSeries.Close[PrevBarIndex] > MarketSeries.Open[PrevBarIndex])
                    Result = 0;
            if (MarketSeries.Close[LastBarIndex] < MarketSeries.Open[LastBarIndex])
                if (MarketSeries.Close[PrevBarIndex] < MarketSeries.Open[PrevBarIndex])
                    Result = 1;
            return Result;
        }
    }
}

@Robot_Forex:  14 Jun 2015, 19:32


@Juddly01

The problem is
ExecuteMarketOrder (TradeType.Buy, Symbol, OrderVolume);

replace by

Trade.CreateBuyMarketOrder(Symbol, OrderVolume);

 

@PayBack II:  03 Oct 2014, 10:06


Bonjour,

J'ai fait une vidéo explicative sur Youtube :

Utilisation de la librairie cAlgoBot

 

@TrailCut II:  03 Oct 2014, 10:03


le lien suivant fonctionne :

cAlgobot Solution

@RsiAtr II:  18 Sep 2014, 16:32


hello,

My English is not very good, I made a youtube video that explains how to compile all the robots and indicators, it is in French, but you can understand with the video without sound.

https://www.youtube.com/watch?v=BMgI88rZs7U

kind regards

@Zelphin Scalper II:  05 Aug 2014, 15:26


Hi,

I do not claim to be the best, I test things out of nothing and look what happens that's it!

@TrailCut II:  25 Jul 2014, 11:11


Solution Visual studio  :    https://calgorobots.codeplex.com/SourceControl/latest

@TrailCut II:  18 Jul 2014, 19:27


il s'agit de la librairie mq4, les sources doivent être inclus avec l'indicateur ZigzagKwanMBFXTiming

Si ce n'est pas le cas: le projet visual studio de MQ4 en téléchargement :

http://sendbox.fr/pro/7oyl6oe909m8/MQ4.zip.html

@TrailCut II:  18 Jul 2014, 14:51


les indicateurs utilisés sont ici :

Williams Percent Range with signals : /algos/indicators/show/523

ZigZag : /algos/indicators/show/157

ZigZag Kwan MBFX Timing : /algos/indicators/show/535

 

@Williams Percent Range with signals:  18 Jul 2014, 11:38


Utiliser "WPR Magic Number" strictement positif (1 ou 2) pour augmenter les gains.

je proposerai bientôt le robot associé qui permet d'obtenir +27669€ entre le 1/1/2014 et 17/07/2014

Remarquer que cet indicateur est meilleur pour les signaux d'achat que ceux de vente, 

@Zephyn Scalper:  17 Jul 2014, 12:18


Ne pas oublier aussi de modifier dans la fonction Open(TradeType tradeType)

ExecuteMarketOrder(tradeType, Symbol, Volume, "ZephynScalper", null, TakeProfit);

par

ExecuteMarketOrder(tradeType, Symbol, Volume, "ZephynScalper", StopLoss, TakeProfit);

@Zephyn Scalper:  17 Jul 2014, 12:13


Le code calculant le nouveau StopLoss est erroné :

à la place de 

foreach (var _p in Positions.FindAll("ZephynScalper", Symbol, TradeType.Buy))

            {

                if (_p.Pips > Trail_start)

                {

                    if (tradePrice < Symbol.Bid)

                    {

                        double NewStopLoss = Symbol.Ask - Trail * Symbol.PipSize;

                        ModifyPosition(_p, NewStopLoss, _p.TakeProfit.Value);

                        tradePrice = Symbol.Ask;

 

                        //Print("Stop loss: " + NewStopLoss);

                        //Print("Current price: " + Symbol.Ask);

                    }

                }

            }

 

            foreach (var _p2 in Positions.FindAll("ZephynScalper", Symbol, TradeType.Sell))

            {

                if (_p2.Pips > Trail_start)

                {

                    if (tradePrice > Symbol.Ask)

                    {

                        double NewStopLoss = Symbol.Bid + Trail * Symbol.PipSize;

                        ModifyPosition(_p2, NewStopLoss, _p2.TakeProfit.Value);

                        tradePrice = Symbol.Bid;

                    }

                }

            }

 

écrire :

foreach (var _p in Positions.FindAll("ZephynScalper", Symbol, TradeType.Buy))

            {

                if (_p.Pips > Trail_start)

                {

                    if (tradePrice < Symbol.Bid)

                    {

                        double NewStopLoss = _p.StopLoss.Value + Trail * Symbol.PipSize;

                        ModifyPosition(_p, NewStopLoss, _p.TakeProfit.Value);

                        tradePrice = Symbol.Ask;

 

                        //Print("Stop loss: " + NewStopLoss);

                        //Print("Current price: " + Symbol.Ask);

                    }

                }

            }

 

            foreach (var _p2 in Positions.FindAll("ZephynScalper", Symbol, TradeType.Sell))

            {

                if (_p2.Pips > Trail_start)

                {

                    if (tradePrice > Symbol.Ask)

                    {

                        double NewStopLoss = _p2.StoLoss.Value - Trail * Symbol.PipSize;

                        ModifyPosition(_p2, NewStopLoss, _p2.TakeProfit.Value);

                        tradePrice = Symbol.Bid;

                    }

                }

            }

 

@Counter Trade:  17 Jul 2014, 11:53


Sorry there is no error

@Counter Trade:  17 Jul 2014, 11:50


Il y a une erreur dans le code :

remplacer 

originalPosition.Label != Label

par

originalPosition.Label == Label

@TrailCut I:  11 Jul 2014, 15:26


L'indicateur WPR est implémenté ainsi :

public override void Calculate(int index)
        {
            double max = MarketSeries.High.Maximum(Period);
            double min = MarketSeries.Low.Minimum(Period);
            double close = MarketSeries.Close[index];

            if ((max - min) > 0)
                Result[index] = -100 * (max - close) / (max - min);
            else
                Result[index] = 0.0;

        }

Comme on utilise le prix de clôture, il ne tient pas compte de la dernière bougie en construction, d'où un décalage

d'autant plus grand que le timeframe est grand.

Pour intégrer la dernière bougie, il faut remplacer

double close = MarketSeries.Close[index];

par

double open= MarketSeries.Open[index];

et 

 Result[index] = -100 * (max - close) / (max - min);

par

 Result[index] = -100 * (max - open) / (max - min);

Cordialement

@PayBack II:  01 Jul 2014, 20:51


Voici une nouvelle version plus performante
Observez qu'on n'utilise aucun signal pour prendre une position, on attends les résultats du marché (par définition efficient) pour clôturer les pertes en premier selon l'adage couper les pertes et laisser courir les gains.

ça marche assez bien!

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

Here is a new, more powerful version 
Observe that uses no signal to take a position, the results of the market (by definition efficient) we expect to close losses in the adage first cut losses and let it run gains. 

it works pretty well!

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

// -------------------------------------------------------------------------------
//
//    PayBack modifie (28 juin 2014)
//      version 1.2014.7.1.19h
//    Abdallah HACID (c) 2014
//    http://www.babooclic.com
//
//    Utiliser : 
//            Volume                =    100000
//          SL                    =    57 pips
//          TP                    =    150 pips
//            commission            =    37.6 per Million
//            Spread fixe            =    1pip
//            Starting Capital    =    50000
//
//    Results :
//          sur GBPUSD en h1 entre le 1/1/2014 et 1/7/2014 a 19h30 gain de 9482 euros(+19%).
//            Net profit            =    9481.93
//            Ending Equity        =    10164.18 euros
//            Ratio de Sharpe        =    0.24
//            Ratio de Storino    =    0.55
// -------------------------------------------------------------------------------

using System;
using cAlgo.API;
using cAlgo;

namespace cAlgo.Robots
{
    [Robot(AccessRights = AccessRights.None)]
    public class PAYBACKII : Robot
    {
        [Parameter("Initial Volume", DefaultValue = 100000, MinValue = 0)]
        public int InitialVolume { get; set; }
        [Parameter("Stop Loss", DefaultValue = 57)]
        public int StopLoss { get; set; }
        [Parameter("Take Profit", DefaultValue = 150)]
        public int TakeProfit { get; set; }

        const long microVolume = 1000;
        const string botLabel = "PB-";


        protected override void OnStart()
        {
            Positions.Opened += OnPositionOpened;
            Positions.Closed += OnPositionClosed;

            relanceOrders();
        }

        private void relanceOrders()
        {
            manageOpen(TradeType.Buy, InitialVolume);
            manageOpen(TradeType.Sell, InitialVolume);
        }

        private void manageOpen(TradeType tradeType, long volume, string prefixLabel = botLabel)
        {
            int nVolumePartition = 10, part1 = 5, part2 = 3;
            long nVol = (long)Math.Floor((double)(volume / (microVolume * nVolumePartition)));
            long partialVolume = nVol * microVolume;

            var result1 = ExecuteMarketOrder(tradeType, Symbol, partialVolume * part1, prefixLabel + tradeType.ToString() + "-1");
            var result2 = ExecuteMarketOrder(tradeType, Symbol, partialVolume * part2, prefixLabel + tradeType.ToString() + "-2");
            var result3 = ExecuteMarketOrder(tradeType, Symbol, volume - (part1 + part2) * partialVolume, prefixLabel + tradeType.ToString() + "-3");
        }

        private void manageClose()
        {
            foreach (var position in Positions)
            {
                if (position.TakeProfit.HasValue)
                {
                    string labelType = position.Label.Substring(position.Label.Length - 1, 1);
                    double potentialGainPips = ((position.TradeType == TradeType.Buy) ? 1 : -1) * (position.TakeProfit.Value - position.EntryPrice) / Symbol.PipSize;
                    double potentialLosePips = ((position.TradeType == TradeType.Buy) ? 1 : -1) * (position.StopLoss.Value - position.EntryPrice) / Symbol.PipSize;
                    double percentGain = position.Pips / potentialGainPips;
                    double percentLose = -position.Pips / potentialLosePips;

                    if ((percentGain >= 0.43) && (labelType == "3"))
                        ClosePosition(position);

                    if ((percentGain >= 0.76) && (labelType == "2"))
                        ClosePosition(position);

                    if ((percentLose <= -0.33) && (labelType == "1"))
                        ClosePosition(position);

                    if ((percentLose <= -0.66) && (labelType == "2"))
                        ClosePosition(position);

                }
            }
        }


        protected void OnPositionOpened(PositionOpenedEventArgs args)
        {
            var position = args.Position;

            //Limits limits = new Limits(position.TradeType, position.EntryPrice, Symbol.PipSize, TakeProfit, StopLoss);

            //position.LimitsExt().SL_PIPS = StopLoss;
            //position.LimitsExt().TP_PIPS = TakeProfit;

            double stopLoss = position.TradeType == TradeType.Buy ? position.EntryPrice - Symbol.PipSize * StopLoss : position.EntryPrice + Symbol.PipSize * StopLoss;
            double takeProfit = position.TradeType == TradeType.Buy ? position.EntryPrice + Symbol.PipSize * TakeProfit : position.EntryPrice - Symbol.PipSize * TakeProfit;

            ModifyPosition(position, stopLoss, takeProfit);
        }

        protected void OnPositionClosed(PositionClosedEventArgs args)
        {

            if (args.Position.Pips < 0)
                manageOpen(args.Position.TradeType==TradeType.Buy ? TradeType.Sell:TradeType.Buy, args.Position.Volume, botLabel + "Mart-");

            if (Positions.Count == 0)
                relanceOrders();
        }


        protected override void OnTick()
        {
            manageClose();

        }
        protected override void OnError(Error error)
        {
            if (error.Code != ErrorCode.BadVolume)
            {
                Print("erreur : " + error.Code);
                Stop();
            }
        }

 

    }
}

 

@ZigZagBot:  29 Jun 2014, 13:58


ZigzagCycleBot gives good results: 

EURUSD, H1, 01/01/2014 to 29/06/2014, zzDepth = 12 StopLoss = 550 ZzDeviation = 5, ZzBackStep = 3, Volume = 100000

@Zephyn Scalper:  29 Jun 2014, 12:06


robot Zephyn sclaper not closing the losers where this apparent performance positions. If we had a look at equity, we see that it is far from being efficient.

@ThirdGenMA Robot:  28 Jun 2014, 21:27


quel paire utiliser sur quelle timeframe ?

@ThirdGenMA Robot:  28 Jun 2014, 21:24


il est ici :

/algos/indicators/show/345

il faut renommer ThirdGenMovingAverage  en  ThirdGenerationMA

@ThirdGenMA Robot:  28 Jun 2014, 21:16


where is the Third Gen Moving Average ?

Last Forum Posts

@How to find the length of the string?:  19 Jul 2015, 14:11


In CSharp you can determine the length of a string by this instruction

            String myString = "myString";
            int length = myString.Length;

@Price between different brokers:  17 Jul 2015, 20:06


ok I see that All broker discussions are prohibited on cTDN.

@Price between different brokers:  17 Jul 2015, 20:03


This post has been removed by the moderator due to a violation of the EULA.

@the time beginning of H4 timeframe:  17 Jul 2015, 19:58


On the cAlgo plateforme when I select H4 timeframe, the begining time of candle was 1h00 (UTC+0)

Why it is not 0h00 ?

@Price between different brokers:  17 Jul 2015, 14:37


This post has been removed by the moderator due to a violation of the EULA.

@Price between different brokers:  17 Jul 2015, 14:36


This post has been removed by the moderator due to a violation of the EULA.

@money management double to float:  14 Jul 2015, 21:55


torokbalint1986

If you want to use double volume, you can use this instructions :

double volume = moneyManagement(RiskPercent, StopLoss);

long normalizedVolume = Symbol.NormalizeVolume(volume, RoundingMode.ToNearest)

ExecuteMarketOrder(tradeType, Symbol, normalizedVolume, _instanceLabel, StopLoss, TakeProfit, 10, comment);

@How to make break-even price between buy & sell.:  14 Jul 2015, 21:41


SaifBD said:

I can make break even price only for buy and only for sell. Here's my code. But I can't make break even price between buy & sell together. Please help me. How can I make this?

        private double pnt_12(TradeType TrdTp)
        {
            double Result = 0;
            double AveragePrice = 0;
            long Count = 0;
            for (int i = Positions.Count - 1; i >= 0; i--)
            {
                position = Positions[i];
                if (position.Label == Label && position.SymbolCode == Symbol.Code)
                {
                    if (position.TradeType == TrdTp)
                    {
                        AveragePrice += position.EntryPrice * position.Volume;
                        Count += position.Volume;
                    }
                }
            }
            if (AveragePrice > 0 && Count > 0)
                Result = Math.Round(AveragePrice / Count, Symbol.Digits);
            return Result;
        }

This code

pnt_12(TradeType TrdTp)

calculate the average price oppositions of type TrdTp. What is the correspondance to Break Even ?

@TimeFrame operators:  14 Jul 2015, 18:52


The solution is simple, I use extensions method to TimeFrame :

#region Licence
//The MIT License (MIT)
//Copyright (c) 2014 abdallah HACID, https://www.facebook.com/ab.hacid

//Permission is hereby granted, free of charge, to any person obtaining a copy of this software
//and associated documentation files (the "Software"), to deal in the Software without restriction,
//including without limitation the rights to use, copy, modify, merge, publish, distribute,
//sublicense, and/or sell copies of the Software, and to permit persons to whom the Software
//is furnished to do so, subject to the following conditions:

//The above copyright notice and this permission notice shall be included in all copies or
//substantial portions of the Software.

//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
//BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
//NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
//DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

// Project Hosting for Open Source Software on Github : https://github.com/abhacid/cAlgoBot
#endregion

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

namespace cAlgo.Lib
{
    /// <summary>
    /// Méthodes d'extensions du type cAlgo.API.TimeFrame
    /// </summary>
    public static class TimeFrameExtensions
    {
        public enum TimeFrameEnum
        {
            Minute,
            Minute2,
            Minute3,
            Minute4,
            Minute5,
            Minute6,
            Minute7,
            Minute8,
            Minute9,
            Minute10,
            Minute15,
            Minute20,
            Minute30,
            Minute45,
            Hour,
            Hour12,
            Hour2,
            Hour3,
            Hour4,
            Hour6,
            Hour8,
            Daily,
            Day2,
            Day3,
            Weekly,
            Monthly,
        }

        public static TimeFrameEnum ToTimeFrameEnum(this TimeFrame timeFrame)
        {
            TimeFrameEnum timeFrameEnum;

            Enum.TryParse<TimeFrameEnum>(timeFrame.ToString(), out timeFrameEnum);

            return timeFrameEnum; 
        }


        public static TimeSpan ToTimeSpan(this TimeFrame timeFrame)
        {
            TimeSpan timeSpan;
            long ticks=0;


            // instruction to transform each TimeFrame.Time in TimeSpan.

            switch(timeFrame.ToTimeFrameEnum())
            {
                case TimeFrameEnum.Minute:
                    ticks = TimeSpan.TicksPerMinute;
                    break;

                case TimeFrameEnum.Minute2:
                    ticks = 2 * TimeSpan.TicksPerMinute;
                    break;

                case TimeFrameEnum.Minute3:
                    ticks =3 * TimeSpan.TicksPerMinute;
                    break;

                case TimeFrameEnum.Minute4:
                    ticks = 4 * TimeSpan.TicksPerMinute;
                    break;

                case TimeFrameEnum.Minute5:
                    ticks = 5 * TimeSpan.TicksPerMinute;
                    break;

                case TimeFrameEnum.Minute6:
                    ticks = 6 * TimeSpan.TicksPerMinute;
                    break;

                case TimeFrameEnum.Minute7:
                    ticks = 7 * TimeSpan.TicksPerMinute;
                    break;

                case TimeFrameEnum.Minute8:
                    ticks = 8 * TimeSpan.TicksPerMinute;
                    break;

                case TimeFrameEnum.Minute9:
                    ticks = 9 * TimeSpan.TicksPerMinute;
                    break;

                case TimeFrameEnum.Minute10:
                    ticks = 10 * TimeSpan.TicksPerMinute;
                    break;

                case TimeFrameEnum.Minute15:
                    ticks = 15 * TimeSpan.TicksPerMinute;
                    break;

                case TimeFrameEnum.Minute20:
                    ticks = 20 * TimeSpan.TicksPerMinute;
                    break;

                case TimeFrameEnum.Minute30:
                    ticks = 30 * TimeSpan.TicksPerMinute;
                    break;

                case TimeFrameEnum.Minute45:
                    ticks = 45 * TimeSpan.TicksPerMinute;
                    break;

                case TimeFrameEnum.Hour:
                    ticks = TimeSpan.TicksPerHour;
                    break;

                case TimeFrameEnum.Hour2:
                    ticks = 2 * TimeSpan.TicksPerHour;
                    break;

                case TimeFrameEnum.Hour3:
                    ticks = 3 * TimeSpan.TicksPerHour;
                    break;

                case TimeFrameEnum.Hour4:
                    ticks = 4 * TimeSpan.TicksPerHour;
                    break;            
            
                case TimeFrameEnum.Hour6:
                    ticks = 6 * TimeSpan.TicksPerHour;
                    break;

                case TimeFrameEnum.Hour8:
                    ticks = 8 * TimeSpan.TicksPerHour;
                    break;

                case TimeFrameEnum.Hour12:
                    ticks = 12 * TimeSpan.TicksPerHour;
                    break;

                case TimeFrameEnum.Daily:
                    ticks = TimeSpan.TicksPerDay;
                    break;

                case TimeFrameEnum.Day2:
                    ticks = 2 * TimeSpan.TicksPerDay;
                    break;

                case TimeFrameEnum.Day3:
                    ticks = 3 * TimeSpan.TicksPerDay;
                    break;

                case TimeFrameEnum.Weekly:
                    ticks = 7 * TimeSpan.TicksPerDay;
                    break;

                case TimeFrameEnum.Monthly:
                    ticks = (long)(30.5 * TimeSpan.TicksPerDay);
                    break;
            }

            timeSpan = TimeSpan.FromTicks(ticks);

            return timeSpan;
        }
    }
}

And I can use in my indicator instructions like this :

        [Parameter()]
        public TimeFrame Global { get; set; }

        protected override void Initialize()
        {
            marketSerieGlobal = MarketData.GetSeries(Global);
            
            int period = (int) (Global.ToTimeSpan().Ticks / MarketSeries.TimeFrame.ToTimeSpan().Ticks);

            _localMA = Indicators.MovingAverage(LocalTrendSignal, period, MovingAverageType.Exponential);

        }

@TimeFrame operators:  14 Jul 2015, 17:47


The TimeFrame class is very poor, the class is :


namespace cAlgo.API
{
    // Summary:
    //     Contains supported timeframe values from Minute 1 to Monthly.
    public class TimeFrame
    {
        public static TimeFrame Daily;
        public static TimeFrame Day2;
        public static TimeFrame Day3;
        public static TimeFrame Hour;
        public static TimeFrame Hour12;
        public static TimeFrame Hour2;
        public static TimeFrame Hour3;
        public static TimeFrame Hour4;
        public static TimeFrame Hour6;
        public static TimeFrame Hour8;
        public static TimeFrame Minute;
        public static TimeFrame Minute10;
        public static TimeFrame Minute15;
        public static TimeFrame Minute2;
        public static TimeFrame Minute20;
        public static TimeFrame Minute3;
        public static TimeFrame Minute30;
        public static TimeFrame Minute4;
        public static TimeFrame Minute45;
        public static TimeFrame Minute5;
        public static TimeFrame Minute6;
        public static TimeFrame Minute7;
        public static TimeFrame Minute8;
        public static TimeFrame Minute9;
        public static TimeFrame Monthly;
        public static TimeFrame Weekly;

        public static bool operator <(TimeFrame x, TimeFrame y);
        public static bool operator <=(TimeFrame x, TimeFrame y);
        public static bool operator >(TimeFrame x, TimeFrame y);
        public static bool operator >=(TimeFrame x, TimeFrame y);

        public override string ToString();
    }
}

It will be more convenient if there is a method like

TimeSpan TimeFrame.ToTimeSpan() 

{

      TimeSpan timespan;

      // instruction to transform each TimeFrame.Time in TimeSpan.

       return timespan;

};

With TimeSpan the operators is very large and it will be more simple to operate on timeframe.

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.
VelociTy Indicator
  0
  0
  2968
free  22 Jul 2015
Indicate the acceleration of the high price and the low price with a moving average.  If the moving average is over ZERO the trend is UP otherwise it's Down. If the green line crosse above the ZERO line in uptrend you can buy. If the green line crosse below the ZERO line in downtrend you can sell. For a best signal use two ceilling line. Project Hosting for Open Source Software on Github : https://github.com/abhacid/cAlgoBot  Copyright (c) 2014 abdallah HACID, https://www.facebook.com/ab.hacid    
Multi Candle
  1
  0
  3545
free  10 Jul 2015
Creates a buy or sell signal soon as bullish candles are N bullish or bearish candle whose size exceeds a given threshold. Project hosted in github
free  27 Jun 2015
indicator print buy/sell signal on the price graph windows when the fast line cross the slow line Author : Abdallah HACID Solution Visual studio
Spread
  0
  0
  6842
free  27 Jun 2015
Spread shows the current spread and its average. You can set the time and type of medium to display. Author : Abdallah HACID Solution Visual studio
PipsATR
  5
  0
  6041
free  27 Jun 2015
PipsATR is nothing other than the ATR indicator, but its values ​​are expressed in pips rather than value.  This gives for each timeframe chosen volatility in pips, which in my opinion is more explicit. On the other hand you can choose the timeframe for which to calculate the volatility; if for example you are  working on h1, you can see the ATR on h4 or on daily. Author : Abdallah HACID Solution Visual studio
Efficiency Ratio
  0
  0
  2797
free  27 Jun 2015
Efficiency Ratio Indicator (ER) measure noise signal, see the article: Mesurer le bruit d'un signal boursier If ER is near to 1.0 the noise is low, it is near to 0 the noise is important. It is better to take a position  when ER is greater than 0.6, for Period=11. Author : Abdallah HACID Solution Visual studio
free  30 Jun 2015
The Adaptive Moving Average (AMA) aka Kaufman Adaptive Moving Average (KAMA) was created by Perry Kaufman and first presented in his book Smarter Trading (1995).  This moving average offered a significant advantage over previous attempts at ‘intelligent’ averages because it allowed the user greater control.  Author : Abdallah HACID Solution Visual studio
free  27 Jun 2015
ZigZag Kwan MBFX Timing ou Beta Author : Abdallah HACID Solution Visual studio   Cet indicateur ZigZag Kwan MBFX Timing peut etre  combiner avec le RSI, MACD est Stoch et vous pouvez créer un système de trading forex parfait. Vert - La tendance  couleur Or - la tendance latérale  Rouge - La tendance baissière  Cet indicateur doit être situé dans les niveaux intermédiaires (30,70). en dessous de 70 survente, au dessus de 30 surachat. Le robot de test de cet indicateur se trouve ici : TrailCut II , mettre le paramètre Zigzag Kwan MBFX Timing à OUI, les autres indicateurs à NON et passer en période journalière.
free  27 Jun 2015
L'indicateur Williams Percent Range avec signaux d'achat ou de vente. Les deux premiers signaux testent le franchissement des seuils de survente (-80) et surachat (-20) tandis que les deux suivants testent une limite haute et basse basee sur un range calcule sur "WPR Min/Max Period" periodes.  Author : Abdallah HACID Solution Visual studio  Utiliser :             WPR Source                        =    Open                                 WPR Period                         =   17             WPR Overbuy Ceil               =    -20       //    Seuil d'oversell             WPR Oversell Ceil               =    -80       //     Seuil d'overbuy             WPR Magic Number             =    2        //     Permet d'etendre le temps de detection du signal (Magic)             WPR Min/Max Period            =    114   //     Periode pendant laquelle on calcule le minimum et le maximum              WPR Exceed MinMax            =    2      //    Decalage par rapport au Minimum et au Maximum pour cloturer les positions  
Warning! Executing cBots downloaded from this section may result in loss of funds. Use them at your own risk.
free  10 Jul 2015
This robot is a fork of Robot_Forex. It is hosted on Github and gives good results. If you want to have the last evolutions of the bot, take it here It manages a stop loss, a money management , a tralling stop and dynamic grid to her positions. For the parameters to use go to Github A video a.bout this bot is on youtube  
RsiAtr II
  10
  0
  4783
free  27 Jun 2015
Robot use the indicators RSI and ATR, with dynamics Stop and Take Profit Money management, supports and resistance.             Symbol                            =    EURUSD             TimeFrame                      =    H4             TP Factor                         =    2.43                                 Volatility Factor                 =   2.7             MM Factor                         =    5        //    Money Management             RSI Source                        =    Close                 RSI Period                         =    14                                     RSI Ceil                             =    1                 ATR Period                        =    20             ATR MAType                      =    VIDYA     Results :           Results                =    entre le 01/01/2014 et 5/8/2014 a 13h00 gain de 44559 euros(+89%).           Net profit              =    47599.19 euros           Ending Equity      =    47599.19 euros The PipsATR indicator is here Author : Abdallah HACID Solution Visual studio
RsiAtr
  27
  0
  3317
free  27 Jun 2015
Robot use the indicators RSI and ATR       RsiAtr (4 Aout 2014)      version 1.2014.8.4.21h00       Author : https://www.facebook.com/ab.hacid Symbol                            =    GBPUSD TimeFrame                        =    H4 Volume                            =    100000 Stop Loss                        =    51 pips Take Profit                        =    153 pips                 RSI Source                        =    Close                     RSI Period                        =   17 RSI Overbuy Ceil                =    70 //    Seuil d'oversell RSI Oversell Ceil                =    30  //    Seuil d'overbuy RSI Min/Max Period            =    70  //    Period during which calculates the minimum and maximum to detect the extent of the range RSI Exceed MinMax                =    3                        //    Lag with the Minimum and Maximum to clore positions ATR Period                        =    20 ATR MAType                        =    Wilder Smoothing Results                =    entre le 01/01/2014 et 4/8/2014 a 21h00 gain de 6961 euros(+14%). Net profit            =    6960.79 euros Ending Equity        =    6993.51 euros  -------------------------------------------------------------------------------            Use in real trading at your own risk. leverage with a risk of loss greater than the capital invested.  ------------------------------------------------------------------------------- The PipsATR indicator is here Author : Abdallah HACID Solution Visual studio
TrailCut II
  7
  0
  4032
free  27 Jun 2015
Multi indicateurs avec seuil de declenchement (ceilSignal),  gerant un trail stop, une cloture anticipee des pertes (Cut Loss)  une martingale selective, Possibilite d'achat ou de vente seulement, Signaux sur Tick ou sur nouvelle barre         TrailCut-II (18 juillet 2014)         version 2.2014.7.13h30 Author : Abdallah HACID Solution Visual studio //    Utiliser : (parametres a modifier avant de tester : Symbol, Timeframe, WprSource) //            Symbol                            =    GBPUSD //            TimeFrame                        =    D1 //            Volume                            =    100000 // //            OnTick                            =    Non                        //    Declanchement des ordres sur chaque nouveau tick ou sur chaque nouvelle barre //          Stop Loss                        =    150 pips //          Take Profit                        =    1000 pips                 //            Cut Loss                        =    Non                        //    Coupe les pertes à 50%, 66% du StopLoss initial //            Buy Only                        =    Non                        //    Execute seulement des ordres sur signaux d'achat //            Sell Only                        =    Non                        //    Execute seulement des ordres sur signaux de vente //            Martingale                        =    Non                     //    En cas de perte inverse la position avec un facteur de 1.5*Volume initial // //            Trail Start                        =    3000                    //    Début du mouvement du stopLoss //            Trail Step                        =    3                        //    Pas du Mouvement de trailling //            Trail Stop                        =    29                        //    Minimum du StopLoss // //            WPR Source                        =    Open                     //            WPR Period                        =   17 //            WPR Overbuy Ceil                =    -20                        //    Seuil d'oversell //            WPR Oversell Ceil                =    -80                        //    Seuil d'overbuy //            WPR Magic Number                =    2                        //    Permet d'etendre le temps de detection du signal et cree plus de signaux (Magic) //            WPR Min/Max Period                =    114                        //    Periode pendant laquelle on calcule le minimum et le maximum pour detecter l'etendue du range //            WPR Exceed MinMax                =    2                        //    Decalage par rapport au Minimum et au Maximum pour cloturer les positions // //            MBFXLen                            =    13 //            MBFX Filter                        =    5 //            ZzDeph                            =    12 //            ZzDeviation                        =    5 //            ZzBackStep                        =    3 // //            commission                        =    37.6 per Million //            Spread fixe                        =    1pip //            Starting Capital                =    50000 // //    Results : //          Resultats            =    entre le 01/04/2011 et 18/7/2014 a 11:30 gain de 34534 euros(+69%). //            Net profit            =    34534.34 euros //            Ending Equity        =    34534.34 euros //            Ratio de Sharpe        =    1.75 sur achats 2.23 sur ventes //            Ratio de Storino    =    -    sur achats - sur ventes // // ------------------------------------------------------------------------------- //            Utiliser en trading reel a vos propres risques.  //            l'effet de levier comportant un risque de perte supérieure au capital investi. // -------------------------------------------------------------------------------
Zelphin Scalper II
  8
  5
  12196
free  27 Jun 2015
programme original de Mark Jensen Zelphin Scalper Author : Abdallah HACID Solution Visual studio   Uses simple moving average and stochastic oscillator to find a good trade opportunity tested using GBPUSD symbol and 5m chart.     Symbole            =    GBPUSD     Timeframe        =    m5     Source            =    Open     Period            =    35     Volume            =    100k     TakeProfit        =    300     StopLoss        =    53     TrailStart        =    29     Trail            =    3     MaType            =    Exponential     K Period        =    5     D Period        =    3     K Slowing        =    3     Results :           Resultats            =    entre le 01/04/2011 et 17/7/2014 a 19:00 gain de 5303 euros(+11%).             Net profit            =    5303,01 euros             Ending Equity        =    5303,01 euros             Ratio de Sharpe        =    0.13             Ratio de Storino    =    0.17 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////                                               Use at own risk /////////////////////////////////////////////////////////////////////////////////////////////////////////////// Ne pas oublier de changer       la Source en Open,       le timeframe en m5,       le MaType en Exponentiel.
TrailCut I
  3
  0
  3118
free  27 Jun 2015
Ce robot de trading est dérivé de PayBack II. Author : Abdallah HACID Solution Visual studio   Il contient plusieurs idées : a) On coupe les pertes rapidement et on laisse courir les gains b) On gère un stop suiveur c) On découpe les ordres en trois ordres de 50% 30% et 20% du volume initial demandé, ce qui permet de clôturer, la position initial de 100% en trois fois selon le contexte de gain ou de perte. d) le code est structuré pour permettre d'implémenter n'importe quelle stratégie donnant soit un signal Buy, soit un signal Sell soit aucun signal (méthode signalStrategie())   Les résultats obtenus sur GBPUSD sont par exemple : // ------------------------------------------------------------------------------- // //        TrailCut-I (17 juillet 2014) //        version 1.2014.7.17.23h //        Author : https://www.facebook.com/ab.hacid // //    Utiliser : //            Symbol                =    GBPUSD //            TimeFrame            =    m30 //            Volume                =    100000 //          SL                    =    57 pips //          TP                    =    300 pips //            Martingale            =    Non //            TrailStart            =    30 //            TrailStep            =    4 //            PeriodWPR           =   14 //            commission            =    37.6 per Million //            Spread fixe            =    1pip //            Starting Capital    =    50000 // //    Results : //          Resultats            =    entre le 1/1/2014 et 17/7/2014 a 23:53 gain de 6904 euros(+16%). //            Net profit            =    7889.76 euros //            Ending Equity        =    7888.76 euros //            Ratio de Sharpe        =    0.37 //            Ratio de Storino    =    0.45 // ------------------------------------------------------------------------------- Il utilise l'indicateur WilliamsPercentRange : /algos/indicators/show/177  
PayBack II
  4
  2.5
  5970
free  27 Jun 2015
Two orders in oposite direction with progressive close positions Author : Abdallah HACID Solution Visual studio     PayBack modifie (28 juin 2014)     version 2.2014.7.1.19h   Utiliser :            Volume              =   100000           SL                  =   57 pips           TP                  =   150 pips           commission          =   37.6 per Million           Spread fixe         =   1pip           Starting Capital    =   50000   Results :           sur GBPUSD en h1 entre le 1/1/2014 et 1/7/2014 a 19h30 gain de 9482 euros(+19%).           Net profit          =   9481.93           Ending Equity       =   10164.18 euros           Ratio de Sharpe     =   0.24           Ratio de Storino    =   0.55   gain de 9481 euros.