TraDerMaTriX

Info
Username: | tradermatrix |
Name: | TraDerMaTriX |
Member since: | 24 Jul 2012 |
Country: | France |
About
Signature
Last Algorithm Comments
@Pending Order on ADX and MACD: 02 Nov 2019, 12:07
Hello
Thank you for sharing your work.
I think line 76 for ADX Sell: if (i_adx.ADX.LastValue> 20) is: (i_adx.ADX.LastValue <20)
Good trade !!
cordially
@SK1 - 28 Pairs Volatility -: 12 Oct 2017, 12:20
hi
thank you for this great work, very technical ...
it just lacks the opening of a command so that this robot is the most remarkable ....
do you have an example or a piece of code adapted to your logic that allows to open and close an order automatically.
cordially
@PAYBACK: 15 Jul 2017, 11:59
sean.cappone:
Because it is the same label ... I will modify the code .... you will be able to use it with several symbols, at the same time.
@cTrader cBot VPS Memory Manager: 09 May 2017, 11:04
Thank you Paul
I will try the adventure
I will communicate the results
@ +
@cTrader cBot VPS Memory Manager: 08 May 2017, 14:19
hello Paul
Does your instrument improve the optimization?
Optimization often slows down the computer's virtual memory considerably.
Your instrument improves the fluidity of a cbot that has opened a large number of orders (and which slows down all functions) for example to close in an instant 20 or 30 trades ....
And finally, I have several computers and several brokers with different accounts a single purchase is it enough ...?
with many thanks.
@Scaling In Bot: 16 Jun 2016, 21:52
Hi,
thank you for the code
I added a indicator to automate the first order...
that helped to understand the operation.
thank you
@ClickAlgo Dashboard Free Version: 30 May 2016, 19:09
Hi Paul
I'd be curious to test with full automation.
I think you can create a basic set and offer it to everyone, (the operation on demo accounts only).
Then everyone could adapt and buy according to their needs (for real accounts) ...
I think you will have a high demand.
I'll be the first to test a desired set of your creation and buy + if affinity ...
Paul thank you for your work.
tradermatrix@hotmail.fr
Cordially
@ClickAlgo Dashboard Free Version: 26 May 2016, 16:01
congratulations for this remarkable work...
is it possible (with these same tools) to create a robot that would take the
decision d buy or sell with the usual settings.?
I wish to no longer remained planted before my screens. I want to go fishing... during labour.... (I'm French..!!!)
Kind regards
@My new Algo: 18 Dec 2015, 10:58
the robot does not work ... can you look
log backtesting ;
18/11/2015 02:00:00.000 | Backtesting was stopped
18/11/2015 02:00:00.000 | Crashed in OnStop with NullReferenceException: La référence d'objet n'est pas définie à une instance d'un objet.
18/11/2015 02:00:00.000 | Crashed in OnStart with UnauthorizedAccessException: L'accès au chemin d'accès 'c:\data.csv' est refusé.
Thank you
@RegressionBot: 09 Dec 2015, 11:48
Hello
thank you for the code.
"closeOnReg" does not.
can you look....." true" or "false" does not change the working robot
Best regards
@HMA Crossover: 02 Sep 2015, 16:16
Hi !!
you reverse StopLoss and TakeProfit
must be corrected as:
ExecuteMarketOrder(TradeType.Buy, Symbol, VolumeInUnits, label, StopLossPips, TakeProfit);
ExecuteMarketOrder(TradeType.Sell, Symbol, VolumeInUnits, label, StopLossPips, TakeProfit);
@PAYBACK: 14 Aug 2015, 14:17
I have added the martingale reverse mode ... but in all cases tp 20 and sl 20 is risky ....
@martingale with SL and MM: 22 Jun 2015, 21:38
cher Abdalah Hacid
Merci pour cette idée et de la partager avec tous....
J ai progressé en regardant vos codes et vos méthodes.
Je suis ok avec Hichem,j ai actuellement le même soucis avec backesting tick data....
Il y a un problème.../forum/calgo-support/5418
Cordialement
Bons Trades
@Multiple Entries Robot: 28 May 2015, 16:46
yes thank you it works.
if [Parameter ("Short Start Level" DefaultValue = 2.0)]
thank you again
@Multiple Entries Robot: 28 May 2015, 14:09
hello
thank you for the code.
I have noticed that sell order does not.
you can watch...?.
cordially
@AggressiveModifyPositions: 08 Sep 2014, 17:36
merci pour le code
j ai construi un robot et inclus ton code.(je travaille déja avec un systeme similaire)
il faut noter que les résultats sont bons pour "_takeProfit".
mais il vaut mieux supprimer le _stopLoss,car il provoque de grandes pertes.
@+
thank you for the code
I have Constructed a robot and included your code. (I work already with a similar system)
note that the results are good for "_takeProfit."
but it is better to remove the _stopLoss because it causes great loss.
@+
@Super Profit: 02 Sep 2014, 18:21
Hello
no, I have completely forgotten this indicator.
I think I will develop this idea.
@TrailCut II: 18 Jul 2014, 18:12
ZigZag Kwan MBFX Timing : /algos/indicators/show/535
Bonjour
Bravo pour ton travail
J ai un probleme avec cet indicateur(il ne veut pas s enregistrer)
Error CS0006: Metadata file 'f:\dev\calgo\library\mq4\bin\debug\calgo.mq4.dll' could not be found
Cordialement
Marc
@Zephyn Scalper: 10 May 2014, 14:29
ligne 158
remplacer null par StopLoss
private void Open(TradeType tradeType)
{
// var position = Positions.Find("ZephynScalper", Symbol, tradeType);
// if (position == null)
// ExecuteMarketOrder(tradeType, Symbol, Volume, "ZephynScalper", StopLoss, TakeProfit);
if (OpenTrades < 2)
{
ExecuteMarketOrder(tradeType, Symbol, Volume, "ZephynScalper", null, TakeProfit);
ExecuteMarketOrder(tradeType, Symbol, Volume, "ZephynScalper", StopLoss, TakeProfit);
OpenTrades++;
}
}
////////////////////////////////////////////////
mais vous devrez regler et changer certains parametres du robot
bons trades
Marc
@Golden Dragon: 09 Oct 2013, 20:14
Hi @nobulart
the bug is here;
[Parameter("Martingale Recursions", DefaultValue = 2, MinValue = 1, MaxValue = 4)]
public int MartingaleMax { get; set; }
[Parameter("Debug Level", DefaultValue = 0, MinValue = 0, MaxValue = 3)]
public int Debug { get; set; }
private int LongPositions = 0, ShortPositions = 0, MaxLong = 0, MaxShort = 0;
private int BuyVolume = 0, TakeProfit = 0, Count = 0, MartingaleActive = 0, Quantity = 0;
"MartingaleActive" : must change line
private int LongPositions = 0, ShortPositions = 0, MaxLong = 0, MaxShort = 0, MartingaleActive = 0;
private int BuyVolume = 0, TakeProfit = 0, Count = 0,, Quantity = 0;
good luck...
@Golden Dragon: 08 Oct 2013, 18:36
Minimum Profit- Only used when Dynamic Targetsare enabled. Specifies the minimum number of pips to be won when targets are being adjusted to track the Target Level line. [ Default = 1 ]
Do you have dynamic targets enabled? If not, does this explain why it doesn't seem to work: yes
nobular hello!
I have also noticed a bug:
[Parameter ("Martingale recursion", DefaultValue = 2, MinValue = 1, MaxValue = 4)] public int MartingaleMax {get; set;}
does not work
cordially
@Golden Dragon: 06 Oct 2013, 16:21
nobular hello!
thank you for this robot and have corrected MM.
I think
[Parameter("Minimum Profit (pips)", DefaultValue = 1, MinValue = 0)]
public int MinimumPips { get; set; }
Parameter"Dynamic Targets":yes
does not work.
cordially
@Golden Dragon: 03 Oct 2013, 18:44
résultat backtesting
par exemple eur/jpy
[Parameter("Lot Size", DefaultValue = 10000, MinValue = 1)]
starting capital $1000 = Volume: 10000.(ok)
////////////////////////////////////////////////////////////////////////////////////////
résultat backtesting
[Parameter("Lot Size", DefaultValue = 10000, MinValue = 1)]
starting capital $ 50000 = Volume: 10000(?)
backtesting gold :
for bactest: depart 1000 euros (volume = 10oz)
the above 2800 euros (volume = 10oz ...!)
@Golden Dragon: 03 Oct 2013, 12:09
protected override void OnStart()
{
DragonID = "Golden Dragon " + DragonNumber + " - " + Symbol.Code;
Count = BuyWait;
BuyVolume = LotSize;
OpeningBalance = Account.Balance;
MaxLong = MaxLongTrades;
MaxShort = MaxShortTrades;
cog = Indicators.GetIndicator<BelkhayatePRC>(cogDegree, cogPeriod, Inner, Middle, Outer);
hull = Indicators.GetIndicator<HMA>(HullPeriod);
if (atr1Period > 0 && atr2Period > 0)
{
atr1 = Indicators.AverageTrueRange(2, MovingAverageType.Simple);
atr2 = Indicators.AverageTrueRange(120, MovingAverageType.Simple);
}
Message(1, "Dragon awakening...");
@Super Profit: 30 Sep 2013, 12:35
hi
Has someone an idea to put it this indicator in a robot.
for example, open a command automatically at the same time AlertMessage.
thank you.
cordially
@Fibonacci Robot: 09 Sep 2013, 21:00
using System;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Requests;
using cAlgo.Indicators;
using System.IO;
using System.Collections.Generic;
using System.Windows;
using System.Linq;
using System.Runtime.InteropServices;
using System.Globalization;
remove from the list:
using System.Windows;
@Robot_Forex: 28 Feb 2013, 02:00
can you explain: [Parameter(DefaultValue = 300)] public int PipStep { get; set; }. the trailing stop does not work merci
@ZigZagBot: 30 Aug 2012, 10:13
bonjour apres plusieurs essais d enregistrement par coller copier ou downloab le resultat est :"creation échouée" error : the type or namespace name'zigzag could not be found (are you missing a using directive or an assembly reference?) l erreur est ici private ZigZag_zigzag; merci de votre comprehension cordialement TRADERMATRIX
Last Forum Posts
@How can i stop my cbot from taking multiple trade using the ontick?: 19 Jan 2021, 21:30
yet it works for me. can be replaced;
var cBotPositions = Positions.FindAll(label);
if (cBotPositions.Length >= 1)
return;
by:
var position = Positions.Find(label);
if (position == null)
@How can i stop my cbot from taking multiple trade using the ontick?: 19 Jan 2021, 14:46
using System;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;
namespace cAlgo.Robots
{
[Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.FullAccess)]
public class FollowtrendcBot : Robot
{
[Parameter(DefaultValue = 1000)]
public double Volume { get; set; }
[Parameter("Stop Loss", DefaultValue = 50)]
public double StopLoss { get; set; }
[Parameter("Take Profit", DefaultValue = 60)]
public double TakeProfit { get; set; }
[Parameter("MA Type", Group = "Moving Average")]
public MovingAverageType MAType { get; set; }
[Parameter("Source", Group = "Moving Average")]
public DataSeries SourceSeries { get; set; }
[Parameter("Slow Periods", Group = "Moving Average", DefaultValue = 10)]
public int SlowPeriods { get; set; }
[Parameter("Fast Periods", Group = "Moving Average", DefaultValue = 5)]
public int FastPeriods { get; set; }
[Parameter("Source", Group = "RSI")]
public DataSeries Source { get; set; }
[Parameter("Periods", Group = "RSI", DefaultValue = 14)]
public int Periods { get; set; }
[Parameter("MACD LongCycle", DefaultValue = 26, MinValue = 1)]
public int LongCycle { get; set; }
[Parameter("MACD ShortCycle", DefaultValue = 12, MinValue = 1)]
public int ShortCycle { get; set; }
[Parameter("MACD Period", DefaultValue = 9, MinValue = 1)]
public int MACDPeriod { get; set; }
private MovingAverage slowMa;
private MovingAverage fastMa;
private MacdCrossOver _MACD;
private RelativeStrengthIndex rsi;
private const string label = "Follow trend cBot";
protected override void OnStart()
{
fastMa = Indicators.MovingAverage(SourceSeries, FastPeriods, MAType);
slowMa = Indicators.MovingAverage(SourceSeries, SlowPeriods, MAType);
rsi = Indicators.RelativeStrengthIndex(Source, Periods);
_MACD = Indicators.MacdCrossOver(LongCycle, ShortCycle, MACDPeriod);
}
protected override void OnTick()
{
var currentSlowMa = slowMa.Result.Last(0);
var currentFastMa = fastMa.Result.Last(0);
var cBotPositions = Positions.FindAll(label);
if (cBotPositions.Length >= 1)
return;
if (rsi.Result.LastValue > 50 && currentFastMa > currentSlowMa && _MACD.MACD.Last(1) > _MACD.Signal.Last(1))
{
ExecuteMarketOrder(TradeType.Buy, Symbol, Volume, label, StopLoss, TakeProfit);
}
else if (rsi.Result.LastValue < 50 && currentFastMa < currentSlowMa && _MACD.MACD.Last(1) < _MACD.Signal.Last(1))
{
ExecuteMarketOrder(TradeType.Sell, Symbol, Volume, label, StopLoss, TakeProfit);
}
}
}
}
@ATR StopLoss problem with US30 indice: 10 Nov 2020, 18:48
PanagiotisCharalampous said:
Hi tradermatrix,
Here you go
SL = Math.Round(ATR.Result.LastValue * ATRfactor / Symbol.PipSize, 1);
Best Regards,
Panagiotis
Thank you for you precious help
It works...
cordially
@ATR StopLoss problem with US30 indice: 10 Nov 2020, 14:38
PanagiotisCharalampous said:
Hi tradermatrix,
You should round the stop loss value to one decimal place before using it.
Best Regards,
Panagiotis
Thank you for your prompt response.
do you have sample code to help me.
I have already tried several methods to round off but without success.
cordially
@ATR StopLoss problem with US30 indice: 10 Nov 2020, 12:10
Hello
with the example below, the c bot works perfectly with the currency. in optimization and in reality ...
and with indices like US30 it works perfectly with baktest or optimization.
But in reality, when starting up, he rejects the purchase or the sale because of:
10/11/2020 10:34:55.510 | → Order OID0 is REJECTED with error "Relative stop loss has invalid precision"
it is probably a decimal problem.
Do you have a solution and an adapted code for this bug
thanks in advance
cordially.
using System;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;
namespace cAlgo
{
[Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class RSIcBotSLATR : Robot
{
[Parameter("RSI.ATR.Label n°", DefaultValue = "777")]
public string RobotID { get; set; }
[Parameter("Volume", DefaultValue = 1)]
public double Volume { get; set; }
[Parameter("RSI Source")]
public DataSeries Source { get; set; }
[Parameter("RSI Periods", DefaultValue = 9)]
public int Periods { get; set; }
[Parameter("RSI BuyPoint", DefaultValue = 30)]
public int BuyPoint { get; set; }
[Parameter("RSI SellPoint", DefaultValue = 70)]
public int SellPoint { get; set; }
[Parameter("ATR Periods", DefaultValue = 14)]
public int ATRPeriod { get; set; }
[Parameter("ATR Moving Average Type", DefaultValue = MovingAverageType.Simple)]
public MovingAverageType MovingAverageTypeATR { get; set; }
[Parameter("SL = ATR multiple", DefaultValue = 2)]
public double ATRfactor { get; set; }
[Parameter("TP", DefaultValue = 300)]
public double TP { get; set; }
public double SL;
private RelativeStrengthIndex rsi;
private AverageTrueRange ATR;
protected override void OnStart()
{
rsi = Indicators.RelativeStrengthIndex(Source, Periods);
ATR = Indicators.AverageTrueRange(ATRPeriod, MovingAverageTypeATR);
}
protected override void OnTick()
{
var cBotPositions = Positions.FindAll(RobotID);
if (cBotPositions.Length >= 1)
return;
SL = ATR.Result.LastValue * ATRfactor / Symbol.PipSize;
if (rsi.Result.LastValue < BuyPoint)
{
ExecuteMarketOrder(TradeType.Buy, SymbolName, Volume, RobotID, SL, TP);
}
else if (rsi.Result.LastValue > SellPoint)
{
ExecuteMarketOrder(TradeType.Buy, SymbolName, Volume, RobotID, SL, TP);
}
}
}
}
@Limit positions with different labels: 27 Jul 2020, 10:56
Hi
I have built a robot with several signals independent of each other, with a different label per signal.
for example :
RobotID_A1
RobotID_A2
RobotID_A3
RobotID_A4
so 4 positions are possible together
I would like to limit to 2 open positions (the robot chooses the 2 best signals depending on the market)
but how to proceed with different labels.
cordially.
@use multiple timers and events OnTimer (): 20 Jul 2020, 17:43
Thank you for your precious help, I will experiment your method and look for a solution to adapt it to my needs.
Best Regards,
@use multiple timers and events OnTimer (): 20 Jul 2020, 16:08
PanagiotisCharalampous said:
Hi tradermatrix,
I do not see why you cannot implement different checks with a single timer event, one for every strategy. It needs some coding but its achievable.
Best Regards,
Panagiotis
Thank you for your reply.
so I am making a mistake.
Do you have a sample code to share?
@use multiple timers and events OnTimer (): 20 Jul 2020, 15:11
PanagiotisCharalampous said:
Hi tradermatrix,
At the moment you can only have one instance of the Timer. You will need to implement your logic with this limitation in mind.
Best Regards,
Panagiotis
Hi Panagiotis
Thank you for your reply.
It is a shame because for example I have a robot with 14 different strategies and I am therefore obliged to keep the same deadlines for all instances.
I even think that if the timer is open on a robot, it also intervenes on another robot in operation.
The "OnTimer ()" timer should be associated with the label, this would create several instances of different timers ...otherwise the method "System.Threading.Thread.Sleep (60000 * _Interval1);" is very easy to use and works on as many desired instances but is still not compatible with backtesting or optimization.
cordially
@use multiple timers and events OnTimer (): 18 Jul 2020, 19:47
Hello
I would like to use multiple timers and events OnTimer ()
For example, I want a timer to count 100 minutes periods and then trigger an event, and another timer to count minutes and trigger an event at 300 minutes.
In the simple example below, if you operate each indicator independently it works perfectly.
But if the 2 indicators work together, it is always the last timer (Interval MACD int _Interval2) which manages all the events ...
Interval MA int _Interval1: no longer useful.
you will realize this by adding the MA + MACD results with a backtesting for each indicator and then a backtesting together ...
I have the impression that we cannot create several partitions with OnTimer ()
I may also be making a coding error
is there another method to work around the problem.
cordially
using System;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;
namespace cAlgo.Robots
{
[Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class EXEMPLEDOUBLETIMER : Robot
{
[Parameter("Volume", DefaultValue = 10000)]
public double volume { get; set; }
[Parameter("----------MA------------", DefaultValue = "MA")]
public string Separator1 { get; set; }
[Parameter("Use MA", DefaultValue = true)]
public bool UseMA { get; set; }
[Parameter("Interval (Minut)", DefaultValue = 100)]
public int _Interval1 { get; set; }
[Parameter("Source")]
public DataSeries Source { get; set; }
[Parameter("Period", DefaultValue = 125)]
public int Period { get; set; }
[Parameter("Moving Average Type", DefaultValue = MovingAverageType.TimeSeries)]
public MovingAverageType MovingAverageType { get; set; }
[Parameter("SL ", DefaultValue = 160)]
public int sl1 { get; set; }
[Parameter("TP ", DefaultValue = 80)]
public int tp1 { get; set; }
[Parameter("----------MACD------------", DefaultValue = "MACD")]
public string Separator2 { get; set; }
[Parameter("Use MAcd", DefaultValue = true)]
public bool UseMACD { get; set; }
[Parameter("Interval (Minut)", DefaultValue = 300)]
public int _Interval2 { get; set; }
[Parameter("MACD LongCycle", DefaultValue = 26, MinValue = 1)]
public int LongCycle { get; set; }
[Parameter("MACD ShortCycle", DefaultValue = 12, MinValue = 1)]
public int ShortCycle { get; set; }
[Parameter("MACD Period", DefaultValue = 9, MinValue = 1)]
public int MACDPeriod { get; set; }
[Parameter("SL ", DefaultValue = 160)]
public int sl2 { get; set; }
[Parameter("TP ", DefaultValue = 80)]
public int tp2 { get; set; }
private MacdHistogram MACD;
private MovingAverage MA;
protected override void OnStart()
{
MA = Indicators.MovingAverage(Source, Period, MovingAverageType);
MACD = Indicators.MacdHistogram(LongCycle, ShortCycle, MACDPeriod);
TIMER();
TIMER2();
}
private void TIMER()
{
if (UseMA)
Timer.Start(_Interval1 * 60);
}
private void TIMER2()
{
if (UseMACD)
Timer.Start(_Interval2 * 60);
}
protected override void OnTimer()
{
ManagePositions1();
ManagePositions2();
}
protected override void OnTick()
{
// ManagePositions1();
// ManagePositions2();
}
private void ManagePositions1()
{
var cBotPositions = Positions.FindAll("MoVinG");
if (cBotPositions.Length >= 1)
return;
double MA2 = MA.Result[MA.Result.Count - 2];
int bars = MarketSeries.Close.Count - 1;
double cl = MarketSeries.Close[bars - 1];
if (UseMA && MA2 < cl)
{
ExecuteMarketOrder(TradeType.Buy, Symbol, volume, "MoVinG", sl1, tp1);
}
else if (UseMA && MA2 > cl)
{
ExecuteMarketOrder(TradeType.Sell, Symbol, volume, "MoVinG", sl1, tp1);
}
}
private void ManagePositions2()
{
var cBotPositions = Positions.FindAll("Macd");
if (cBotPositions.Length >= 1)
return;
if (UseMACD && MACD.Histogram.LastValue > 0.0 && MACD.Signal.IsRising())
{
ExecuteMarketOrder(TradeType.Buy, Symbol, volume, "Macd", sl2, tp2);
}
else if (UseMACD && MACD.Histogram.LastValue < 0.0 && MACD.Signal.IsFalling())
{
ExecuteMarketOrder(TradeType.Sell, Symbol, volume, "Macd", sl2, tp2);
}
}
}
}