Topics
Replies
PanagiotisCharalampous
05 Jun 2019, 09:22
Hi bienve.pf,
This is not available in cTrader Copy since it features a different copying logic. It is based on an equity to equity model. In this case, it is the strategy provided who decides the amount to be risked and followers copy the trades in their accounts proportionately.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
05 Jun 2019, 09:13
Hi 1222Ht,
It seems fine to me. Is there anything you need help with?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
05 Jun 2019, 09:06
Hi Trading Sniper,
Thank you for posting in our forum. Renko charts are not available on cTrader Web yet.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
04 Jun 2019, 16:24
Hi diegorcirelli,
In this case you will need to place limit orders with the desired price. See below an example
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 NewcBot : Robot { [Parameter("Buy", DefaultValue = true)] public bool TradeTypeBuy { get; set; } [Parameter(DefaultValue = 1)] public int Volume { get; set; } [Parameter(DefaultValue = "myLabel")] public string cBotLabel { get; set; } [Parameter(DefaultValue = 480)] public double TakeProfitPips { get; set; } [Parameter(DefaultValue = 1500)] public double StopLossPips { get; set; } [Parameter("Posição", DefaultValue = 1300)] public double EntryPrice { get; set; } protected TradeType cBotTradeType { get { return TradeTypeBuy ? TradeType.Buy : TradeType.Sell; } } protected override void OnStart() { Positions.Opened += OnPositionsOpened; Positions.Closed += OnPositionsClosed; ExecuteMarketOrder(cBotTradeType, Symbol, Volume, cBotLabel, StopLossPips, TakeProfitPips, EntryPrice); } protected void OnPositionsOpened(PositionOpenedEventArgs args) { var position = args.Position; if (position.Label == cBotLabel) Print("Position opened by cBot"); } private void OnPositionsClosed(PositionClosedEventArgs args) { var position = args.Position; if (position.Label == cBotLabel) { Print("Position closed by cBot"); PlaceLimitOrder(position.TradeType, Symbol, position.VolumeInUnits, position.EntryPrice, cBotLabel, StopLossPips, TakeProfitPips); } } } }
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
04 Jun 2019, 09:51
Hi midyadeb,
Thanks for posting in our forum. You will find the following resources helpful
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
04 Jun 2019, 09:49
Hi diegorcirelli,
Thank you for posting in our forum. However it is not clear from your post what is the problem you are trying to solve. Could you please try explaining it in more detail?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
04 Jun 2019, 09:46
Hi lec0456,
Please contact your broker to check this. They can check the status of your accounts via their backend systems.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
04 Jun 2019, 09:45
Hi zedodia,
You can always reach out to our Consultants of post a Job as well.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
04 Jun 2019, 09:42
Hi HOMERUN,
Thanks for posting in our forum. This method can only be used in indicators. When cBots are running changing symbol and/or timeframe is not allowed.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
04 Jun 2019, 09:27
Hi RayAdam,
You are retrieving the same data in both cases, this is why the lines are drawn at the exact same place. At the moment, you cannot retrieve Range bars using MarketData.GetSeries().
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
03 Jun 2019, 15:27
Hi El Antonio,
No it shouldn't. Leverage is only related to the amount of margin required to open a position. If the volume of the position is the same then the result of backtesting will stay the same.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
03 Jun 2019, 11:51
Hi John,
If you want to stop following a strategy, just click on the menu button on the right of the subaccount and choose "Stop Copying". Hi you want to hide subaccounts that have been stopped, use the cog button on the top of the accounts tree and uncheck "Stopped".
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
03 Jun 2019, 11:01
Hi RayAdam,
Thanks for posting in our forum. I had a look at your indicator but I cannot see any problem. I can see the lines in Range Bar 10 pips. Could you please elaborate?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
03 Jun 2019, 10:45
Hi El Antonio,
Can you share the cBot so that we can reproduce?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
03 Jun 2019, 10:37
Hi asencanada,
How can we help you?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
03 Jun 2019, 10:29
Hi Matt,
The code below should work on the latest version of cTrader
using System; using cAlgo.API; using cAlgo.API.Internals; using cAlgo.API.Indicators; using cAlgo.Indicators; namespace cAlgo { [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] public class BidAsk : Indicator { [Parameter("To Infinite", DefaultValue = true)] public bool ToInfinite { get; set; } [Parameter(DefaultValue = 0)] public int Displacement { get; set; } [Output("Ask", Color = Colors.DodgerBlue, PlotType = PlotType.DiscontinuousLine)] public IndicatorDataSeries SymbolAsk { get; set; } [Output("Bid", Color = Colors.Red, PlotType = PlotType.DiscontinuousLine)] public IndicatorDataSeries SymbolBid { get; set; } protected override void Initialize() { // Initialize and create nested indicators } public override void Calculate(int index) { if (!IsLastBar) return; SymbolBid[index + Displacement - 1] = double.NaN; SymbolAsk[index + Displacement - 1] = double.NaN; for (int i = ToInfinite ? -MarketSeries.Close.Count : Displacement; i < 200; i++) { SymbolBid[index + i] = Symbol.Ask; SymbolAsk[index + i] = Symbol.Bid; } } } }
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
31 May 2019, 15:14
Hi mpistorius,
At the moment to keep the objects on the charts you need to make them interactive. Here is an example how to make them interactive
var line = Chart.DrawVerticalLine("line", Time, Color.Red); line.IsInteractive = true;
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
31 May 2019, 14:44
Hi andywhitehi,
Can you please let us know which videos are you referring to?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
31 May 2019, 10:47
Hi Max,
I thing I am still missing something since if this was the code you are using then the solution would be as simple as this
private void CloseAllPositions() { foreach (Position p in Positions.Where(p => p.Label == BotLabel).ToArray()) ClosePosition(p); ExecuteMarketOrder(TradeType.Buy, Symbol, Volume, BotLabel, null, 5); }
However I am sure this is not the case :) and this is just an exampe. From what I understand, the positions are closed by TP so you are not sure when did all the positions close and if there are other Closed events coming. So my suggestion is to keep each position you open in a collection (list, dictionary etc) and remove it from the collection as soon as you receive the Closed event for that position. As soon as the collection is empty (meaning all positions closed successfully) you can proceed with sending the new order.
Let me know if this gives you a direction.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
05 Jun 2019, 09:25
Hi diegorcirelli,
If you are looking for somebody to implement your strategy, you can contact a Consultant or post a Job.
Best Regards,
Panagiotis
@PanagiotisCharalampous