Topics
Replies
PanagiotisCharalampous
19 Jun 2024, 05:04
Hi all,
This has been implemented in v5.0.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
19 Jun 2024, 05:01
Hi there,
Mobile applications use push notifications for price alerts. The sound of the notification is a device setting, so check the configuration in your OS.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
18 Jun 2024, 10:38
RE: RE: RE: RE: RE: RE: RE: RE: Changing timeframe while backtesting using visual backtesting
bcronje said:
Hi Beyers,
The timeframe will change as soon as you start backtesting again.
Best regards,
Panagiotis
Hi Panagiotis,
I think there's some misunderstanding here. I do not want to rerun the backtest on a different timeframe. I want to for example backtest on H1, and when the backtest finishes change the timeframe on the backtest window to M30 or M15 to analyze in more detail what actually happened in the lower timeframes, while still keeping the trade history of the H1 backtest. I'm fairly new to cTrader and automated trading in general, but I would've thought this would be a common scenario for testing and finetuning?
Maybe I could to set the cBot timeframe as an input parameter (H1), and then run the backtest with M15 timeframe? Or would this not be possible?
Kind regards
Beyers
Hi Beyers,
Ok understood. Such an option is not available at the moment.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
18 Jun 2024, 10:37
Hi there,
Thank you for reporting this issue. Could you please send us some troubleshooting information the next time this happens? Please paste a link to this discussion inside the text box before you submit it.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
18 Jun 2024, 10:35
RE: RE: Error CS1503
said.moridi said:
PanagiotisCharalampous said:
Hi, off course, sorry.
I created this code to get data from my local api, show on the chart and connect the different values to a line.
The last error I keep getting is
Error CS1503: argument 3: CannotUnloadAppDomainException convert from 'system.DataTime' to 'int'
I tried everything :)
Hi Said,
The message is self explanatory. You cannot use a DateTime in the place of an int. Also you are using an obsolete method. Try something like the below instead
Chart.DrawText($"algo1_{data.OpenTime}", "•", data.OpenTime, (double)data.Close, Color.White);
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
18 Jun 2024, 10:27
RE: RE: RE: RE: Apply as default settings for objects doesn't work
ericlooi said:
PanagiotisCharalampous said:
ericlooi said:
PanagiotisCharalampous said:
Hi there,
I have just tried this option and works fine. Can you provide more information e.g. record a video demonstrating this happening?
Best regards,
Panagiotis
Hi,
Here it is:
Take a look
Thank you. The color is not saved as part of the default settings by design.
Best regards,
Panagiotis
Why Color cannot be saved as default settings?
Because this setting is shared amongst all drawing tools and will cause more confusion
@PanagiotisCharalampous
PanagiotisCharalampous
18 Jun 2024, 09:14
RE: RE: OnBar and OnBarClosed issues when using Renko chart
yohtza said:
PanagiotisCharalampous said:
Hi there,
This is by design. If the price jumps more that one bar, then the method is only executed once for the last bar.
Best regards,
Panagiotis
Any suggestions on how to keep the drawing behavior consistent would be greatly appreciated.
Thanks
On each bar you should keep track how many bars have been added using Bars.Count. If more than one bars have been added then you would need to add the numbers using a loop for all the new bars added
@PanagiotisCharalampous
PanagiotisCharalampous
18 Jun 2024, 09:10
Hi there,
Please provide more information about your problem. What is the exact issue?
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
18 Jun 2024, 09:09
RE: RE: Apply as default settings for objects doesn't work
ericlooi said:
PanagiotisCharalampous said:
Hi there,
I have just tried this option and works fine. Can you provide more information e.g. record a video demonstrating this happening?
Best regards,
Panagiotis
Hi,
Here it is:
Take a look
Thank you. The color is not saved as part of the default settings by design.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
18 Jun 2024, 09:07
RE: RE: RE: RE: RE: Crash in visual mode during backtest and StopLoss not set duing backtest
ys2310 said:
Hi Panagiotis,
I'm using ICMarkets. How can I check and prevent this using code?
PanagiotisCharalampous said:
ys2310 said:
ys2310 said:
PanagiotisCharalampous said:
Hi there,
We have received the exception and the issue will be solved in an upcoming release.
Regarding the SL issue, we would need the cBot code and backtesting parameters in order to reproduce this and explain what happens.
Best regards,
Panagiotis
Hi Panagiotis,
Here is the test code that produce the SL issue, I'm using Nikkei225, Hm1 for testing
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using cAlgo.API;
using cAlgo.API.Collections;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
namespace cAlgo.Robots
{
[Robot(AccessRights = AccessRights.FullAccess, TimeZone = TimeZones.EasternStandardTime)]
public class Test2 : Robot
{
[Parameter(DefaultValue = 10, MinValue = 0, MaxValue = 500, Step = 10)]
public int lossCut { get; set; }
[Parameter(DefaultValue = 10, MinValue = 0, MaxValue = 500, Step = 10)]
public int takeProfit { get; set; }
double volume = 0.0;
protected override void OnStart()
{
// To learn more about cTrader Automate visit our Help Center:
// https://help.ctrader.com/ctrader-automate
}
protected override void OnBarClosed()
{
volume = 10;
var last_buy_position = Positions.Where(x => x.Label == "Test" && x.SymbolName == Symbol.Name && x.TradeType == TradeType.Buy).OrderByDescending(x => x.EntryTime).FirstOrDefault();
// Handle price updates here
if(MarketData.GetBars(TimeFrame, "US500").ClosePrices.Last(0) > MarketData.GetBars(TimeFrame, "US500").OpenPrices.Last(0))
if (last_buy_position == null || Symbol.Ask < last_buy_position.EntryPrice - 100 * Symbol.TickSize)
ExecuteMarketOrder(TradeType.Buy, Symbol.Name, volume, "Test", lossCut, takeProfit, (Server.Time - Bars.Last(0).OpenTime).Milliseconds.ToString());
}
protected override void OnTick() {
foreach(var position in Positions.FindAll("Test", Symbol.Name))
if(position.StopLoss == null)
ModifyPositionAsync(position, Symbol.Ask - 20 * Symbol.PipSize, position.TakeProfit);
}
protected override void OnStop()
{
// Handle cBot stop here
}
}
}
Can you also tell me the broker? This usually happens when your SL falls within the symbol's spread. Please check if this is the case
Hi there,
You can use Positions.Opened event and check if the stop loss was set. If the stop loss is null you can act accordingly i.e. place it at a valid distance.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
18 Jun 2024, 05:37
Hi there,
It's better to ask your broker why this happened.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
18 Jun 2024, 05:36
Hi there,
It's better to ask your broker why this happened.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
18 Jun 2024, 05:36
RE: RE: RE: Crash in visual mode during backtest and StopLoss not set duing backtest
ys2310 said:
ys2310 said:
PanagiotisCharalampous said:
Hi there,
We have received the exception and the issue will be solved in an upcoming release.
Regarding the SL issue, we would need the cBot code and backtesting parameters in order to reproduce this and explain what happens.
Best regards,
Panagiotis
Hi Panagiotis,
Here is the test code that produce the SL issue, I'm using Nikkei225, Hm1 for testing
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using cAlgo.API;
using cAlgo.API.Collections;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
namespace cAlgo.Robots
{
[Robot(AccessRights = AccessRights.FullAccess, TimeZone = TimeZones.EasternStandardTime)]
public class Test2 : Robot
{
[Parameter(DefaultValue = 10, MinValue = 0, MaxValue = 500, Step = 10)]
public int lossCut { get; set; }
[Parameter(DefaultValue = 10, MinValue = 0, MaxValue = 500, Step = 10)]
public int takeProfit { get; set; }
double volume = 0.0;
protected override void OnStart()
{
// To learn more about cTrader Automate visit our Help Center:
// https://help.ctrader.com/ctrader-automate
}
protected override void OnBarClosed()
{
volume = 10;
var last_buy_position = Positions.Where(x => x.Label == "Test" && x.SymbolName == Symbol.Name && x.TradeType == TradeType.Buy).OrderByDescending(x => x.EntryTime).FirstOrDefault();
// Handle price updates here
if(MarketData.GetBars(TimeFrame, "US500").ClosePrices.Last(0) > MarketData.GetBars(TimeFrame, "US500").OpenPrices.Last(0))
if (last_buy_position == null || Symbol.Ask < last_buy_position.EntryPrice - 100 * Symbol.TickSize)
ExecuteMarketOrder(TradeType.Buy, Symbol.Name, volume, "Test", lossCut, takeProfit, (Server.Time - Bars.Last(0).OpenTime).Milliseconds.ToString());
}
protected override void OnTick() {
foreach(var position in Positions.FindAll("Test", Symbol.Name))
if(position.StopLoss == null)
ModifyPositionAsync(position, Symbol.Ask - 20 * Symbol.PipSize, position.TakeProfit);
}
protected override void OnStop()
{
// Handle cBot stop here
}
}
}
Can you also tell me the broker? This usually happens when your SL falls within the symbol's spread. Please check if this is the case
@PanagiotisCharalampous
PanagiotisCharalampous
18 Jun 2024, 05:34
RE: RE: Playback feature and c bots /algos
QuantumTrader.pro said:
PanagiotisCharalampous said:
Hi there,
Why don't you use backtesting to test your cBots?
Best regards,
Panagiotis
I've been looking for the optimization / backtesting section for my cBot. Since the update, I haven't been able to locate it. I'm using Desktop version 5.0.25
As responded in another thread, here they are
@PanagiotisCharalampous
PanagiotisCharalampous
18 Jun 2024, 05:31
Hi there,
It's where it always was
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
18 Jun 2024, 05:28
Hi there,
Please provide some description of your problem.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
18 Jun 2024, 05:25
Hi there,
This option is only available in cTrader v5.0.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
18 Jun 2024, 05:24
RE: RE: RE: RE: RE: RE: Changing timeframe while backtesting using visual backtesting
bcronje said:
PanagiotisCharalampous said:
bcronje said:
PanagiotisCharalampous said:
After the backtest finishes it is possible to change the timeframe
How do I do that? When my backtest finishes, I am unable to change the timeframe on the backtest tab, the options are greyed out. Changing the timeframe under the Algo left panel does not update the backtest window timeframe either.
Hi there,
It looks like a bug. You should be able to change it from the instance.
Best regards,
Panagiotis
Hi Panagiotis,
I can indeed change the timeframe from the instance as per you screenshot, but the problem is when you change it there the chart on the finished backtesting tab is not changed, it stays on the timeframe of when you ran the backtest.
Kind regards
Beyers
Hi Beyers,
The timeframe will change as soon as you start backtesting again.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
18 Jun 2024, 05:22
Hi there,
I have just tried this option and works fine. Can you provide more information e.g. record a video demonstrating this happening?
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
19 Jun 2024, 05:05
RE: RE: RE: RE:
Investec said:
Hi there,
How do you know that there is no open position?
Best regards,
Panagiotis
@PanagiotisCharalampous