forex.pm forex forum binary options trade - Forex - Algoritmik forex ticareti.
  • Welcome to forex.pm forex forum binary options trade. Please login or sign up.
 

Algoritmik forex ticareti.

Started by PocketOption, Apr 24, 2020, 06:54 am

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

PocketOption

Algoritmik forex ticareti.
I've tested this Robot with EURUSD and GBPUSD in H1 timeframe with good results. But the problem is, that in one account I can run only one currency pair (e.g. EURUSD), not together with GBPUSD. Can someone have a look at it please?
How to install cBots & Indicators.
Download the Indicator or cBot. Double-click on the downloaded file. This will install all necessary files in cAlgo. Find the indicator/cbot you want to use from the menu on the left. Add an instance of the indicator/cBot to run.
Download the Indicator Double-click on the downloaded file. This will install all necessary files in cTrader. Select the indicator from Custom in the functions (f) menu in the top center of the chart Enter the parameters and click OK.
You might want to use labels (see /forum/whats-new/labels-and-a-new-method-to-create-orders) or a List (see /forum/calgo-reference-samples/56) for the positions opened by each robot in order to control only the positions of each robot. GetPositionsSide() loops through all the positions under the account and if one currency has the opposite direction of the other then it returns -1, thus not effectively controlling the direction of each currency and resulting in no action. If you need help with the code please post a question in the Robot (cBot) Development Support section of the forum (/forum/cbot-support).
can you explain: [Parameter(DefaultValue = 300)] public int PipStep . the trailing stop does not work merci.
this is not a trailing stop, this the value for open the next trade if the markt goes in the "wrong" direction (martingale part).
I am impressed about results of this robot in backtesting, especially GBPUSD and I want to ask you if you could tell something more about it. What is the purpose of your robot's strategy? Do you use it with live / demo account successfully? I have the impression that it works a bit differently than in backtesting but it may be due to interruptions in his work when I'm not online 24H. Thank you in advance!
Can you share some more info about this robot? Thanks.
Hi, how does this system choose it's entries, and exits? Does it pick the direction for it's entries based on a trailing stop parameter, or moving average, etc? Also, once an order is filled I do not see any changes to the stop loss (it remains at "-") so how are stops triggered (just 5 pips against the trade)? And if the previous trade was a loser then are new trades always opened in the opposite direction, but with 2x the lots of the previous trade (Martingale)?
Can you add trailing stop and stop loss at robot? Thanks.
Hi, there is someone that use this indicator in real account?
sorry mates, i mean this robot.
This is a hedging robot that opens new trades based upon average values of other open trades.

PocketOption

It works fine on the main pairs in backtesting but it has a flaw: after and during the test you see beautifull results, but there can remain some open trades with ultra high losses, as it doesn't close trades with a stop loss. As soon as you add a stoploss to the trades, the results will probably fall dramatically, because trades are not in balance anymore.
Have not tested this live, but that is what the code teaches me. It has no real strategy than hedging. Quite a risk.
I understand everything about this martingal but tralstart and tralstop. Someone can tell me what this is for?
Thank you for your answer.
Please guys. Tralstart and Tralstop!?
I am a beginner. We try in five steps. When the big announcement, I'll try to stop. It is a very good performance, but what if you have five or more away in the opposite direction, without creating a stop-loss, in both dollars and if you began to step in the opposite direction? But is the wrong way. . Is it possible to add a tag? I want to try.
This cbot is really fine- it starts with a minimum of 10000 units.
I want to work with smaller amounts and to start with an amout of 1000 units.
Can anybody tell me how to change the cbots definitions ?
Thanks for your support !
Hi CTDN Team and Members,
Does anyone have five minutes to fix this code?
I've had a go but I'm a beginner and pretty lame.
I cleaned up all the Account.Positions, TickSize and Trade.ModifyPosition warnings.
I replaced the Trade.CreateBuyMarketOrder.
Im stuck on the if (Trade.IsExecuting)
And the 2nd batch of Trade.Create.
There must be a bug elsewhere also as the Tral_Start and Tral_Stop Parameters seem to have absolutely no effect.
Any help would be really appreciated and I think you guys could probs fix it in 3mins flat.
Its actually a good Bot even with the bugs and I'm curious to see its results when working as originally designed.
It would be a shame to leave a broken Bot in the library.

PocketOption

@Juddly01.
The problem is ExecuteMarketOrder (TradeType.Buy, Symbol, OrderVolume);
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.
[Parameter(DefaultValue = 10000, MinValue = 1000)] public int LotStep.
//[Parameter(DefaultValue = 300)] //public int PipStep.
[Parameter("Stop_Loss", DefaultValue = 50, MinValue = 0)] public int Stop_Loss.
[Parameter("Take_Profit", DefaultValue = 180, MinValue = 10)] public int TakeProfit.
[Parameter("Tral_Start", DefaultValue = 50, MinValue = 10)] public int Tral_Start.
[Parameter("Tral_Stop", DefaultValue = 50, MinValue = 10)] public int Tral_Stop.
[Parameter(DefaultValue = 5, MinValue = 2)] public int MaxOrders.
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);
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 0 && Count > 0) Result = AveragePrice / Count; return Result; >
private int GetPositionsSide() int Result = -1; int i, BuySide = 0, SellSide = 0;
for (i = 0; i /// The gradient variable is a dynamic value that represente an equidistant grid between /// the high value and the low value of price. /// /// 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 = 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 HighestPrice) HighestPrice = MarketSeries.High[i]; if (MarketSeries.Low[i] 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] June 14, 2015 @ 23:24.



PocketOption

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.
The statistic of the new version is here :
Hi CTDN Team and Members,
Can anyone explain me how to add label to opened positions. So I would know that the position has been opened by Robot_Forex.
FYI I am not programmer so please explain to me in a simpler way. After which line number the text needs to be add etc.
the new versions gives 3 errors.
after optimizing and backtesting the robot works fine but unfortunatelly only in backtesting. In the demo account the robot in EURUSD 1H do not open any positions or even if, than with no stop loss and with an error message.
07/04/2016 11:03:30.940 | Robot_Forex, EURUSD, h1 | Request to modify position XXXXXXXXX failed with error "TRADING_BAD_STOPS".
After adding the stop loss manually, the robot continues to work with it and modifies as needed but the robot itself is somehow not able to attach the stop loss by itself.
Currently testing on Pepperstone ECN demo with leverage 1:500 with following settings.
First lot 1000 (this has been modified in cAlgo by me)
Anyboty has a tip how to correct the behaviour of missing StopLoss.
Thanks in advance.
why does equity drop very quickly at the end of a backtest?
I am trying to compile the code with the current version and it gives two errors.
It's as if it were using another cAlgo library or similar issue.
Could you please help me out?
any can modify this so it can open orders in diferentes currency at the same time by adding magic index or somthin.
i already fixed the the trail stop and start and add magic index to use it for many currencies same time , contact me for more details.
Would be nice also to change the min lot from 10k to 1k.
have anyone tried this on a live account? then how does the SL work?
@MudiCapital How to contact you? Thank you.
I have corrected most mistakes. However, I do not get along with the following and need help. 1.


PocketOption


"if (Trade.IsExecuting) return" is deprecated. Against which command should / must I swap this? 2. "if (Positions.Count double can not be implicitly converted to "long". An explicit conversion already exists (possibly a conversion is missing) How do I fix this error? Here the complete Code: 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.
[Parameter(DefaultValue = 10000, MinValue = 1000)] public int LotStep.
//[Parameter(DefaultValue = 300)] //public int PipStep.
[Parameter("Stop_Loss", DefaultValue = 50, MinValue = 0)] public int Stop_Loss.
[Parameter("Take_Profit", DefaultValue = 180, MinValue = 10)] public int TakeProfit.
[Parameter("Tral_Start", DefaultValue = 50, MinValue = 10)] public int Tral_Start.
[Parameter("Tral_Stop", DefaultValue = 50, MinValue = 10)] public int Tral_Stop.
[Parameter(DefaultValue = 5, MinValue = 2)] public int MaxOrders.
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);
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.SymbolName == Symbol.Name)
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 0 && Count > 0) Result = AveragePrice / Count; return Result; >
private int GetPositionsSide() int Result = -1; int i, BuySide = 0, SellSide = 0;
for (i = 0; i /// The gradient variable is a dynamic value that represente an equidistant grid between /// the high value and the low value of price. /// /// private void ControlSeries() const int BarCount = 25; int gradient = MaxOrders - 1;
foreach (Position position in Positions.FindAll(botLabel, SymbolName)) if (-position.Pips > Stop_Loss) ClosePosition(position);
//if (PipStep == 0) int _pipstep = GetDynamicPipstep(BarCount, gradient); //else // _pipstep = PipStep;
if (Positions.Count = LotStep) ExecuteMarketOrder(TradeType.Buy, SymbolName, 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, SymbolName, 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 HighestPrice) HighestPrice = MarketSeries.High[i]; if (MarketSeries.Low[i] 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] July 08, 2019 @ 03:14.
two errors: can someone help to fix them pls.
Error CS0612: 'cAlgo.API.Robot.Trade' is obsolete.
Error CS0266: Cannot implicitly convert type 'double' to 'long'. An explicit conversion exists (are you missing a cast?)
"Error CS0612: 'cAlgo.API.Robot.Trade' is obsolete"
to me is a Warning: Error CS0612: 'cAlgo.API.Robot.Trade' is obsolete.
Error CS0266: Cannot implicitly convert type 'double' to 'long'. An explicit conversion exists (are you missing a cast?)
may you fix so? long NewVolume = ( long )Symbol.NormalizeVolumeInUnits(FirstLot + FirstLot * Positions.Count, RoundingMode.ToNearest);

The FirstLot is 10000. Can it be changed to a smaller lot for mini accounts?