Topics
29 Jun 2017, 15:26
 0
 1140
 1
24 Nov 2016, 02:56
 2179
 1
Replies

aimerdoux
23 Jun 2015, 00:06

RE:

please notify us we really need  the backtesting ... my email is aimerdoux@hotmail.com

Spotware said:

Dear Traders,

We are aware of this issue with the tick data backtesting. Our team is working on resolving this issue as soon as possible.

 

 

 

 


@aimerdoux

aimerdoux
22 Jun 2015, 19:50

RE: RE:

nobulart said:

Spotware said:

Dear Traders,

We are aware of this issue with the tick data backtesting. Our team is working on resolving this issue as soon as possible.

 

 

 

Thanks for the update folks. Good to know that the problem is being addressed.

nobulart do you know why the robot Golden Dragon II doesnt run the bactesting?


@aimerdoux

aimerdoux
07 Jun 2015, 01:46

RE:

cAlgo_Fanatic said: hello i have a problem using this cbot in my sample code cbot it doesnt allow me to build the bot and shows this problem Error CS1501: Ninguna sobrecarga para el método 'ExecuteMarketOrder' toma '5' argumentos id appreciate your help

// -------------------------------------------------------------------------------------------------
//
//    The "SampleTrailingbyLabel" cBot will trail an open position given the position Label. 
//    The user can set the variable "Trigger (pips)" 
//    which defines the point where the Stop Loss will start 
//    trailing the order. When the profit in pips is above or equal to "Trigger (pips)" 
//    the stop loss will start trailing the spot price.
//    Variable "Trailing Stop (pips)" defines the number of pips the Stop Loss trails the spot price by. 
//
// -------------------------------------------------------------------------------------------------

using System;
using cAlgo.API;

namespace cAlgo.Robots
{
    [Robot("Sample Trailing Stop Robot")]
    public class SampleTrailingbyLabel : Robot
    {

        [Parameter("Position Label", DefaultValue = "My Label")]
        public string MyLabel { get; set; }

        [Parameter("Trigger (pips)", DefaultValue = 20)]
        public int Trigger { get; set; }

        [Parameter("Trailing Stop (pips)", DefaultValue = 10)]
        public int TrailingStop { get; set; }

        private bool _isTrigerred;
        
        protected override void OnStart()
        {
            Positions.Opened += PositionsOnOpened;
            ExecuteMarketOrder(TradeType.Buy, Symbol, 10000, MyLabel);
        }

        private void PositionsOnOpened(PositionOpenedEventArgs args)
        {
            var position = args.Position;
            Print("Position {0} found, waiting for trigger.", position.Label);
        }

        protected override void OnTick()
        {
            var position = Positions.Find(MyLabel);
            
            if (position == null) return;

            if (position.TradeType == TradeType.Buy)
            {
                double distance = Symbol.Bid - position.EntryPrice;

                if (distance >= Trigger * Symbol.PipSize)
                {
                    if (!_isTrigerred)
                    {
                        _isTrigerred = true;
                        Print("Trailing Stop Loss triggered...");
                    }

                    double newStopLossPrice = Math.Round(Symbol.Bid - TrailingStop * Symbol.PipSize, Symbol.Digits);

                    if (position.StopLoss == null || newStopLossPrice > position.StopLoss)
                    {
                        ModifyPosition(position, newStopLossPrice, position.TakeProfit);
                    }
                }
            }
            else
            {
                double distance = position.EntryPrice - Symbol.Ask;

                if (distance >= Trigger * Symbol.PipSize)
                {
                    if (!_isTrigerred)
                    {
                        _isTrigerred = true;
                        Print("Trailing Stop Loss triggered...");
                    }

                    double newStopLossPrice = Math.Round(Symbol.Ask + TrailingStop * Symbol.PipSize, Symbol.Digits);

                    if (position.StopLoss == null || newStopLossPrice < position.StopLoss)
                    {
                        ModifyPosition(position, newStopLossPrice, position.TakeProfit);
                    }
                }
            }
        }

    }
}

 

 


@aimerdoux