Topics
Load cBot parameters from file

completed Closed cTrader Automate

Suggestions
21 Jan 2014, 07:51
 19
 1367
 3
Optimization

completed Closed cTrader Automate

Suggestions
14 Jan 2014, 12:29
 273
 2179
 6
Replies

modarkat
29 Jun 2015, 15:54

There is a free visual builder that can generate cBots for cTrader/cAlgo: 


@modarkat

modarkat
06 Apr 2015, 16:40

You can use cMirror for that.

https://www.cmirror.com/


@modarkat

modarkat
23 Mar 2015, 10:38

Waiting for your results...


@modarkat

modarkat
17 Mar 2015, 17:45

Are you sure that you pass correct string? Try "1.23" and "1,23"


@modarkat

modarkat
12 Mar 2015, 17:51

Difference in pips between SMA and Bid price:

        SimpleMovingAverage sma;

        protected override void OnStart()
        {
            sma = Indicators.SimpleMovingAverage(MarketSeries.Close, 14);
        }

        protected override void OnTick()
        {
            var pipsDifference = (Symbol.Bid - sma.Result.LastValue) / Symbol.PipSize;
        }

 


@modarkat

modarkat
03 Mar 2015, 17:57

Calculating SL pips based on SL in deposit currency and Volume:

var moneyToInvestInQuoteCurrency = moneyToInvestInDepositCurrency / (Symbol.PipValue / Symbol.PipSize);
var stopLossPips = moneyToInvestInQuoteCurrency / (volume * Symbol.PipSize)

 


@modarkat

modarkat
27 Feb 2015, 15:10

There are other interesting functions you can implement in GetFitness:

http://tradinggame.com.au/introduction-to-backtesting-metrics-part-2/

My favorite one is PROM.

 


@modarkat

modarkat
16 Feb 2015, 11:44

Colors:

White = 16777215;
Snow = 16448255;
MintCream = 16449525;
LavenderBlush = 16118015;
AliceBlue = 16775408;
Honeydew = 15794160;
Ivory = 15794175;
Seashell = 15660543;
WhiteSmoke = 16119285;
OldLace = 15136253;
MistyRose = 14804223;
Lavender = 16443110;
Linen = 15134970;
LightCyan = 16777184;
LightYellow = 14745599;
Cornsilk = 14481663;
PapayaWhip = 14020607;
AntiqueWhite = 14150650;
Beige = 14480885;
LemonChiffon = 13499135;
BlanchedAlmond = 13495295;
LightGoldenrod = 13826810;
Bisque = 12903679;
Pink = 13353215;
PeachPuff = 12180223;
Gainsboro = 14474460;
LightPink = 12695295;
Moccasin = 11920639;
NavajoWhite = 11394815;
Wheat = 11788021;
LightGray = 13882323;
PaleTurquoise = 15658671;
PaleGoldenrod = 11200750;
PowderBlue = 15130800;
Thistle = 14204888;
PaleGreen = 10025880;
LightBlue = 15128749;
LightSteelBlue = 14599344;
LightSkyBlue = 16436871;
Silver = 12632256;
Aquamarine = 13959039;
LightGreen = 9498256;
Khaki = 9234160;
Plum = 14524637;
LightSalmon = 8036607;
SkyBlue = 15453831;
LightCoral = 8421616;
Violet = 15631086;
Salmon = 7504122;
HotPink = 11823615;
BurlyWood = 8894686;
DarkSalmon = 8034025;
Tan = 9221330;
MediumSlateBlue = 15624315;
SandyBrown = 6333684;
DarkGray = 11119017;
CornflowerBlue = 15570276;
Coral = 5275647;
PaleVioletRed = 9662683;
MediumPurple = 14381203;
Orchid = 14053594;
RosyBrown = 9408444;
Tomato = 4678655;
DarkSeaGreen = 9419919;
Cyan = 16776960;
MediumAquamarine = 11193702;
GreenYellow = 3145645;
MediumOrchid = 13850042;
IndianRed = 6053069;
DarkKhaki = 7059389;
SlateBlue = 13458026;
RoyalBlue = 14772545;
Turquoise = 13688896;
DodgerBlue = 16748574;
MediumTurquoise = 13422920;
DeepPink = 9639167;
LightSlateGray = 10061943;
BlueViolet = 14822282;
Peru = 4163021;
SlateGray = 9470064;
Gray = 8421504;
Red = 255;
Magenta = 16711935;
Blue = 16711680;
DeepSkyBlue = 16760576;
Aqua = 16776960;
SpringGreen = 8388352;
Lime = 65280;
Chartreuse = 65407;
Yellow = 65535;
Gold = 55295;
Orange = 42495;
DarkOrange = 36095;
OrangeRed = 17919;
LimeGreen = 3329330;
YellowGreen = 3329434;
DarkOrchid = 13382297;
CadetBlue = 10526303;
LawnGreen = 64636;
MediumSpringGreen = 10156544;
Goldenrod = 2139610;
SteelBlue = 11829830;
Crimson = 3937500;
Chocolate = 1993170;
MediumSeaGreen = 7451452;
MediumVioletRed = 8721863;
FireBrick = 2237106;
DarkViolet = 13828244;
LightSeaGreen = 11186720;
DimGray = 6908265;
DarkTurquoise = 13749760;
Brown = 2763429;
MediumBlue = 13434880;
Sienna = 2970272;
DarkSlateBlue = 9125192;
DarkGoldenrod = 755384;
SeaGreen = 5737262;
OliveDrab = 2330219;
ForestGreen = 2263842;
SaddleBrown = 1262987;
DarkOliveGreen = 3107669;
DarkBlue = 9109504;
MidnightBlue = 7346457;
Indigo = 8519755;
Maroon = 128;
Purple = 8388736;
Navy = 8388608;
Teal = 8421376;
Green = 32768;
Olive = 32896;
DarkSlateGray = 5197615;
DarkGreen = 25600;
Fuchsia = 16711935;
Black = 0;


@modarkat

modarkat
16 Feb 2015, 09:40

If I set Commission per Million = 9

Where did you find broker with such commissions?


@modarkat

modarkat
10 Feb 2015, 10:10

Here you go:

http://www.algochart.com/


@modarkat

modarkat
15 Jan 2015, 17:39

Have you checked cMirror ?


@modarkat

modarkat
04 Nov 2014, 11:27

You must pass absolute price to the ModifyPosition method.

Example:

            var takeProfitPips = 40;
            var stopLossPips = 20;
            
            var stopLoss = position.TradeType == TradeType.Buy ? position.EntryPrice - stopLossPips * Symbol.PipSize : position.EntryPrice + stopLossPips * Symbol.PipSize;
            var takeProfit = position.TradeType == TradeType.Buy ? position.EntryPrice + stopLossPips * Symbol.PipSize : position.EntryPrice - stopLossPips * Symbol.PipSize;
            ModifyPosition(position, stopLoss, takeProfit);

 


@modarkat

modarkat
21 Oct 2014, 09:19

Sorry, correct link is: /algos/indicators/show/32


@modarkat

modarkat
21 Oct 2014, 09:15

1) Download /forum/ctrader-support/3731?page=1#1

2) Double click on downloaded file

3) Find DEMA in indicators menu


@modarkat

modarkat
28 Aug 2014, 11:02

The easiest way to emulate global variables is a Registry:

http://www.codeproject.com/Articles/3389/Read-write-and-delete-from-registry-with-C


@modarkat

modarkat
25 Aug 2014, 10:18

ROC.rocline.Last(0) - current value,

ROC.rocline.Last(1) - previous value


@modarkat

modarkat
25 Aug 2014, 10:15

Here you go:

            var m1Series = MarketData.GetSeries(TimeFrame.Minute);
            var m1Bid = m1Series.Close.Last(0);

 


@modarkat

modarkat
20 Aug 2014, 14:53

Here you go:

/algos/indicators/show/557


@modarkat

modarkat
19 Aug 2014, 14:41

Yes, there are plenty of collections in c#:

http://msdn.microsoft.com/en-us/library/ybcx56wz.aspx


@modarkat