Topics
14 Jul 2015, 17:47
 4825
 2
08 Jul 2015, 22:07
 3642
 12
18 Jun 2015, 22:54
 3201
 1
11 Sep 2014, 23:46
 3056
 4
07 Aug 2014, 22:35
 2928
 2
27 Jul 2014, 16:51
 2454
 2
18 Jul 2014, 20:54
 2499
 4
partial close in backtesting

completed Closed cTrader Automate

Suggestions
28 Jun 2014, 12:49
 74
 1398
 3
Replies

aysos75
19 Jun 2015, 23:43

RE:

Spotware said:

Dear Trader,

When you registered you were asked to insert a desired username and password in order to create your free user account. The “3104134" is the username you selected. You cannot change it.

No, before my name was written completely and on the other hand on data from my account this is my name that appears.


@aysos75

aysos75
15 Jun 2015, 21:44

RE:

Spotware said:

Dear Trader,

You will be informed as soon as this functionality is available for cAlgo users. Currently we cannot specify an ETA.

Could you please give as an explanation why you think the historical data of cAlgo is bad and not usable?

What is ETA ?


@aysos75

aysos75
13 Sep 2014, 01:10

In the first graphics (old cAlgo) I use the unique mode provide

In the second graph (new cAlgo with optimization) I use the tick mode.

 


@aysos75

aysos75
11 Sep 2014, 23:48

How about time to fix that problem ?


@aysos75

aysos75
12 Aug 2014, 00:30 ( Updated at: 21 Dec 2023, 09:20 )

RE: RE: RE: RE: RE:

 

 I have made another indicator for visualising bid, ask and the average weigted price (barycentre =bid*volBid+ask*volAsk)/(volBid+volAsk). This indicator work in protrader3 platform, 

The line in blue is the average weigted price.


@aysos75

aysos75
08 Aug 2014, 16:02 ( Updated at: 21 Dec 2023, 09:20 )

RE: RE: RE:

 


@aysos75

aysos75
08 Aug 2014, 16:01 ( Updated at: 21 Dec 2023, 09:20 )

RE: RE:

Abdallah_Hacid said:

motu828mk2 said:

hi

anyone can make an simple spread pips logging indicator

which displays and log history of the current spread , minimum/maximum spread values on a separate log chart window  ??

something like this spread  log history

 

thanks

 

Yes I Can do that

see cAlgoBots in two or three days.

You can now find the indicator at this adress : 

Spread Indicator

The entire solution cAlgoBot/Indicator/Spread is here 

Best Regards


@aysos75

aysos75
06 Aug 2014, 08:24 ( Updated at: 21 Dec 2023, 09:20 )

RE:

motu828mk2 said:

hi

anyone can make an simple spread pips logging indicator

which displays and log history of the current spread , minimum/maximum spread values on a separate log chart window  ??

something like this spread  log history

 

thanks

 

Yes I Can do that

see cAlgoBots in two or three days.


@aysos75

aysos75
05 Aug 2014, 00:00

RE:

admin said:

UPDATED

This robot 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.

 

// -------------------------------------------------------------------------------------------------
//  In "Sample Sell Trailing" Robot 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.
//  Until this condition is met the user can set a normal Stop Loss using the "Stop Loss (pips)" variable. 
//  Variable "Trailing Stop (pips)" defines the number of pips the Stop Loss trails the spot price by. 
//  The user can select to also set a take profit in his order with parameter "Take Profit (pips)". 
//
// -------------------------------------------------------------------------------------------------

using cAlgo.API;

namespace cAlgo.Robots.Samples
{
    [Robot("Sample Buy Trailing Robot", TimeZone = TimeZones.UTC)]
    public class SampleSellTrailing : Robot
    {
        [Parameter(DefaultValue = 10000)]
        public int Volume { get; set; }

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

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

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

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

        protected override void OnStart()
        {
            ExecuteMarketOrder(TradeType.Sell, Symbol, Volume, "SampleSellTrailing", StopLoss, TakeProfit);
        }

        protected override void OnTick()
        {
            var position = Positions.Find("SampleSellTrailing");

            if (position == null)
            {
                Stop();
                return;
            }

            double distance = position.EntryPrice - Symbol.Ask;

            if (distance >= Trigger * Symbol.PipSize)
            {
                double newStopLossPrice = Symbol.Ask + TrailingStop * Symbol.PipSize;
                if (position.StopLoss == null || newStopLossPrice < position.StopLoss)
                {
                    ModifyPosition(position, newStopLossPrice, position.TakeProfit);
                }
            }
        }
    }
}

 

This code is bad!

because the test 

distance >= Trigger * Symbol.PipSize

is alway true!

and 

newStopLossPrice = Symbol.Ask + TrailingStop * Symbol.PipSize;

is away from the initial stop.


@aysos75

aysos75
02 Aug 2014, 22:40

RE:

MANDRIL said:

Hi, I'm trying to add a Trailing stop loss to this robot but i'm going crazy using some examples, whether they don't work or they stop my robot.

 

Thanks a lot :)

A generic method to add trailling stop to a robot :

/// <summary>
		/// Manage Trail Stop
		/// </summary>
		/// <param name="position">Used position</param>
		/// <param name="robot">instance of the current robot</param>
		/// <param name="trailStart">start of the movement of stoploss</param>
		/// <param name="trailStep">steps stoploss</param>
		/// <param name="trailStopMin">Minimal StopLoss</param>
		/// <param name="isModifyPosition">change the stoploss position or not ?</param>
		/// <returns>The new stoploss</returns>
		public static double? trailStop(this  Position position, Robot robot, int trailStart, int trailStep, int trailStopMin, bool isModifyPosition=true)
		{
			double? newStopLoss = position.StopLoss;	
			
			if (position.Pips > trailStart)
			{
				double actualPrice = position.isBuy() ? robot.Symbol.Bid : robot.Symbol.Ask;
				int factor = position.factor();

				if ((actualPrice - newStopLoss) * factor > (trailStep + trailStopMin) * robot.Symbol.PipSize)
				{
					newStopLoss += factor * trailStep * robot.Symbol.PipSize;

					if (isModifyPosition && newStopLoss != position.StopLoss)
						robot.ModifyPosition(position, newStopLoss, position.TakeProfit.Value);
				}
			}

			return newStopLoss;
		}

The entire library code is at this adress : calgobots


@aysos75

aysos75
02 Aug 2014, 22:29

RE: RE:

Ermisl said:

 

ChartObjects.DrawHorizontalLine(objectName, y, color, [optional] thickness, [optional] style)

hope that helps.

Thank


@aysos75

aysos75
27 Jul 2014, 16:52

RE:

 New link for cAlgoBots library

Solution Visual studio 


@aysos75

aysos75
26 Jul 2014, 12:01

RE: RE:

Invalid said:

I appreciate you work. Would be better to have comments in English in your solution for those who cares about comments. 

 

For new reviews I write in English.

 

best regards. 


@aysos75

aysos75
21 Jul 2014, 18:46 ( Updated at: 21 Dec 2023, 09:20 )

RE: RE:

Abdallah_Hacid said:

Abdallah_Hacid said:

Je viens de créer un projet de développement d'une libraire cAlgo pour réunir les méthodes récurrentes utilisées dans le développement de robots en CSharp avec cAlgo.

http://calgolib.codeplex.com

 

The new link is 

 

https://calgorobots.codeplex.com/

The new link is 

 

https://calgorobots.codeplex.com/


@aysos75

aysos75
21 Jul 2014, 18:45 ( Updated at: 21 Dec 2023, 09:20 )

RE:

Abdallah_Hacid said:

Je viens de créer un projet de développement d'une libraire cAlgo pour réunir les méthodes récurrentes utilisées dans le développement de robots en CSharp avec cAlgo.

http://calgolib.codeplex.com

 

The new link is 

 

https://calgorobots.codeplex.com/


@aysos75

aysos75
19 Jul 2014, 20:52

RE: RE:

Abdallah_Hacid said:

Abdallah_Hacid said:

how to get the name of a robot defines 

[Robot ("Name", TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] 
public class TrailCutII: Robot 
... 

from the base type Robot?

 

If suffit de faire :

		/// 

/// Obtient le nom du robot ///

///L'instance du robot actuel /// Le nom du type dérivé de Robot et définissant une nouvelle instance de Robot public static string name(this Robot robot) { return robot.ToString(); }

 

Par contre comment obtenir le nom définit dans l'atribut

[Robot ("Name", TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] 
public class TrailCutII: Robot 
... 

 


@aysos75

aysos75
19 Jul 2014, 20:50

RE:

Abdallah_Hacid said:

how to get the name of a robot defines 

[Robot ("Name", TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] 
public class TrailCutII: Robot 
... 

from the base type Robot?

 

If suffit de faire :

		/// <summary>
		/// Obtient le nom du robot
		/// </summary>
		/// <param name="robot">L'instance du robot actuel</param>
		/// <returns>Le nom du type dérivé de Robot et définissant une nouvelle instance de Robot</returns>
		public static string name(this Robot robot)
		{
			return robot.ToString();
		}

 


@aysos75

aysos75
29 Jun 2014, 22:04

RE:

 

I tested this robot on h4 between 24.01.2014 and 06.29.2014 and was a monstrous loss of € -20,318 (-41%)! 


@aysos75

aysos75
18 Nov 2013, 00:23

RE: RE:

hichem said:

Why you don't take a step by step ?  They don't work for me...

pparpas said:

I am in the process of finding the best possible automated platform that covers my needs. By using cAlgo, is there any way to debug robots by using Visual Studio? I have made many trials using Visual Studio and trying to attach the debugger to calgo process with no luck.

 

Debugging a robot in Visual Studio is possible. But you should compile the robot to a .dll file with Visual Studio. Then you should reference the generated .dll in cAlgo and after executing the robot in cAlgo you should attach VS debugger.

 


@aysos75

aysos75
17 Nov 2013, 23:25 ( Updated at: 21 Dec 2023, 09:20 )

RE: RE:

bfis108137 said: 

 

don't work :

 

admin said:

You can create a class library in c#. Make sure you add a reference to the cAlgo.API and that you are using .NET framework 4. You can build the project in visual studio and set the project output path to the folder where the indicators/robots are saved. This will create the algo file and then you will need to create an empty text (cs) file with the same name so that you can find it in the indicators/robots list and execute it there. Alternatively you may just copy paste the code into the cAlgo editor and just build it there. 

Let us know if you require additional help.

 

 

Have you actually tried this?  When I create create a class library, it puts a whole bunch of files in the Robots folder and it doesn't compile to algo file.  This is of course because a class library is a dll file.  The only way I have found is to code the robot in vs, and then copy the code to cAlgo editor and compile there.  I think probably a better soltion would be to implement a few features in the cAlgo editor and I think most people would be happy.  Features like hotkeys for things like build and run, code blocking so after you write a function or region you can colapse it so it doesn't get in the way, search, and comment out block of text with hotkey.  If these were implemented I think most people wouldn't even care about visual studio.  Obviously if there was a way in force visual studio to use the cAlgo comiler then this might be easier but I don't know too much about that.

 


@aysos75