Topics
Replies
PanagiotisCharalampous
27 Jan 2020, 09:50
Hi Douglas,
Unfortunately no. I will discuss this with the product team to see if it can be added in future updates of the API.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
27 Jan 2020, 09:46
Hi there,
See an example below
PlaceStopOrder(TradeType.Buy, Symbol.Name, 1000, MarketSeries.High.Maximum(200));
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
27 Jan 2020, 09:43
Hi Carlos,
cBot/Indicator code is saved locally so you cannot automatically update it from one computer to another. If you want to synchronize the development of cBots/Indicators between different computers, you will need to consider a third party source control system like GitHub or TFS.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
27 Jan 2020, 09:37
Hi twoheartzin1soul,
If you want to avoid such a scenario, I would suggest to place the stoploss after the position is opened at a certain distance from the bid/ask price, to make sure that it falls outside the spread. You can use ModifyStopLossPrice() to do so.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
24 Jan 2020, 15:55
Hi wiktor,
When you logout then the connection is dropped by the server and you need to reconnect.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
24 Jan 2020, 15:40
Hi zendoo,
Sure, you can send it at community@spotware.com.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
24 Jan 2020, 14:45
Hi twoheartzin1soul,
Most probably the reason behind this is that the SL falls inside the spread hence in cannot be placed.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
24 Jan 2020, 08:41
Hi Cenedese Mauro,
Thanks for posting your suggestion. Please use the Suggestions section for such suggestions, preferably in English.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
24 Jan 2020, 08:35
Hi snowchilli,
There is no problem with the code. The errors or warnings that you get come from the C# compiler, not from cTrader. The code is a valid C# code. But instead of a property, you declared a variable.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
24 Jan 2020, 08:21
Hi zendoo,
Can you please send us the indicator to check?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
23 Jan 2020, 08:32
Hi snowchilli,
You did not add a getter and a setter. See below the correct way to do this
[Parameter(DefaultValue = enmABC.B)]
public enmABC ABC { get; set; }
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
23 Jan 2020, 08:25
Hi R. Vadivelan,
To modify a stop loss at any time, you can use the ModifyStopLossPrice or ModifyStopLossPips functions.
Regarding
Also is there any way to stop all running bots by a shortcut or another Cbot, because it is difficult to close 1 by 1 especially when working in multiple tabs.
There is no build in API function for this but you could code a solution by yourself e.g. by a raising a flag written in a file.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
23 Jan 2020, 08:20
Hi roshan.singh18504,
Can you please try a clean installation and let us know if it resolves the problem?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
22 Jan 2020, 11:20
Hi RodMar,
Thanks, I asked the product team to update the reference so that this property is available there as well.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
22 Jan 2020, 10:19
Hi pbballa9,
See my responses below
- You cannot use Renko for backtesting at the moment
- Not sure what do you mean with missing Renko candles. Can you elaborate.
- Slippage is not taken into account for backtesting since DoM information is not available
- If you need assistance with the translation, you can contact a Consultant
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
22 Jan 2020, 10:02
Hi DelTrader,
This happens because you increase the value HistoricalProfitInCash on every tick. This should be a local variable and not a global one. See below
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 Teste : Robot
{
[Parameter("1st Symbol", Group = "First Symbol", DefaultValue = "EURUSD")]
public string FirstSymbol { get; set; }
[Parameter("Lote: Buy Symbol", Group = "First Symbol", DefaultValue = 0.01, MinValue = 0.01)]
public double QuantityToFirst { get; set; }
[Parameter("2nd Symbol", Group = "Second Symbol", DefaultValue = "USDJPY")]
public string SecondSymbol { get; set; }
[Parameter("Lote: Sell Symbol", Group = "Second Symbol", DefaultValue = 0.01, MinValue = 0.01)]
public double QuantityToSecond { get; set; }
[Parameter("Date (ddMMyyyy)", Group = "Settings", DefaultValue = "21012020")]
public string TodaysDate { get; set; }
private double VolumeInUnitsFirst
{
get { return Symbol.QuantityToVolumeInUnits(QuantityToFirst); }
}
private double VolumeInUnitsSecond
{
get { return Symbol.QuantityToVolumeInUnits(QuantityToSecond); }
}
private Symbol FirstSymbolGetSymbol, SecondSymbolGetSymbol;
private const string Label = "Teste - ";
private int _FirstSymbolCount, _SecondSymbolCount;
protected override void OnStart()
{
FirstSymbolGetSymbol = Symbols.GetSymbol(FirstSymbol);
SecondSymbolGetSymbol = Symbols.GetSymbol(SecondSymbol);
HistoricalTradeByLabel();
}
protected override void OnTick()
{
HistoricalTradeByLabel();
_FirstSymbolCount = Positions.Where(p => p.Label == Label + "1stSymbol " + FirstSymbol + " 2ndSymbol " + SecondSymbol + " - " + TodaysDate).Where(p => p.TradeType == TradeType.Buy).Count(p => p.SymbolName == FirstSymbol);
_SecondSymbolCount = Positions.Where(z => z.Label == Label + "1stSymbol " + FirstSymbol + " 2ndSymbol " + SecondSymbol + " - " + TodaysDate).Where(z => z.TradeType == TradeType.Buy).Count(z => z.SymbolName == SecondSymbol);
if (_FirstSymbolCount == 0)
ExecuteMarketOrder(TradeType.Buy, FirstSymbolGetSymbol.Name, VolumeInUnitsFirst, Label + "1stSymbol " + FirstSymbol + " 2ndSymbol " + SecondSymbol + " - " + TodaysDate, 0, 10);
if (_SecondSymbolCount == 0)
ExecuteMarketOrder(TradeType.Buy, SecondSymbolGetSymbol.Name, VolumeInUnitsSecond, Label + "1stSymbol " + FirstSymbol + " 2ndSymbol " + SecondSymbol + " - " + TodaysDate, 0, 10);
}
private void HistoricalTradeByLabel()
{
var HistoricalProfitInCash = 0.0;
//foreach (HistoricalTrade trade in History.FindAll(Label + "1stSymbol " + FirstSymbol + " 2ndSymbol " + SecondSymbol + " - " + TodaysDate))
foreach (HistoricalTrade trade in History)
{
//if (trade.Label.Contains(Label + "1stSymbol " + FirstSymbol + " 2ndSymbol " + SecondSymbol + " - " + TodaysDate))
if (trade.Label == (Label + "1stSymbol " + FirstSymbol + " 2ndSymbol " + SecondSymbol + " - " + TodaysDate))
{
HistoricalProfitInCash += trade.NetProfit;
}
}
Chart.DrawStaticText("LabelOutputForTeste", NewLine(10) + "HistoricalProfitInCash: " + HistoricalProfitInCash + " €", VerticalAlignment.Top, HorizontalAlignment.Right, Color.Yellow);
}
private string NewLine(int n)
{
return new string('\n', n);
}
}
}
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
21 Jan 2020, 11:51
Hi Rob.
Try posting a Job or contacting a Consultant.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
21 Jan 2020, 11:13
Hi Jitterbug,
The link seems fine to me. Alternatively search for cTrader Official in Telegram.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
21 Jan 2020, 10:40
Hi snowchilli,
Based on the error code, you are using a wrong method name
Error CS0115: 'cAlgo.Robots.ScalperBot.OnStop(cAlgo.API.ErrorCode)': no suitable method found to override
You have pasted the OnError() method code but it seems your actual method is called OnStop(). If you paste your complete cBot code, we can check and fix this for you.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
27 Jan 2020, 09:53
Hi traderfxmaster007,
We do not have any updates at the moment regarding this request.
Best Regards,
Panagiotis
Join us on Telegram
@PanagiotisCharalampous