
Topics
Replies
PanagiotisCharalampous
12 Jun 2020, 08:19
Hi tgjobscv,
Your steps are not very clear, Can you please provide more details on this problem? If you can record a video then it would be helpful.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
11 Jun 2020, 16:56
Hi Ton,
Quoting below your words
My goal is to not wait until the tick-handling has finished but to force the chart to display the drawn text immediately.
Hope you can help.
and this is what I replied to. I helped you achieve your goal.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
11 Jun 2020, 14:46
Hi Ton,
This is by design. If you want to execute lengthy tasks better use another thread. See below
using System;
using cAlgo.API;
using cAlgo.API.Requests;
using cAlgo.API.Internals;
namespace cAlgo
{
[Robot(AccessRights = AccessRights.None)]
public class Test5 : Robot
{
protected override void OnStart()
{
Chart.DrawStaticText("X", "Test", VerticalAlignment.Top, HorizontalAlignment.Center, "FFFFFFFF");
}
bool Done = false;
protected override void OnTick()
{
Print("Tick");
Chart.DrawStaticText("Y", "\n" + Symbol.Bid, VerticalAlignment.Top, HorizontalAlignment.Center, "FFFFFFFF");
if (Done)
return;
Done = true;
var thread = new System.Threading.Thread(RunSomeTask);
thread.Start();
}
private void RunSomeTask()
{
BeginInvokeOnMainThread(() => { Print("Thread started"); });
DateTime Until = DateTime.Now.AddSeconds(10);
while (DateTime.Now < Until)
{
BeginInvokeOnMainThread(() => { Chart.DrawStaticText("Time", DateTime.Now.ToString("HH:mm:ss.fff"), VerticalAlignment.Bottom, HorizontalAlignment.Center, "FFFFFFFF"); });
System.Threading.Thread.Sleep(50);
}
Chart.DrawStaticText("Time", "Task Finished", VerticalAlignment.Bottom, HorizontalAlignment.Center, "FFFFFFFF");
BeginInvokeOnMainThread(() => { Print("Thread finished"); });
}
}
}
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
11 Jun 2020, 14:07
Hi genappsforex,
As the message indicates cAlgo.API.ChartStaticText doesn't contain these properties. They are only included in cAlgo.API.ChartText.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
11 Jun 2020, 12:58
Hi Luca,
The cBot code is not complete. Please post the complete cBot code.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
11 Jun 2020, 12:51
Hi ericsson,
Thanks for reporting this. We are aware of the issue and we will fix it in the next hotfix for 3.8.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
11 Jun 2020, 12:47
( Updated at: 21 Dec 2023, 09:22 )
Hi Alphatrader,
Just drag the time counter to the left
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
11 Jun 2020, 12:44
( Updated at: 21 Dec 2023, 09:22 )
Hi Noppanon,
It works fine for us.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
11 Jun 2020, 12:06
( Updated at: 21 Dec 2023, 09:22 )
Hi aaronlandonal301,
This happens because you have the option below selected
If you uncheck it, you should not experience this behavior anymore.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
11 Jun 2020, 11:59
Hi orsica,
The problem is that you do not use the correct indices. See below how to code this properly
Bars eurUsd_series;
Bars eurGbp_series;
protected override void Initialize()
{
eurUsdTSI = CreateDataSeries();
eurGbpTSI = CreateDataSeries();
eurUsd_series = MarketData.GetBars(TimeFrame.Hour, "EURUSD");
eurGbp_series = MarketData.GetBars(TimeFrame.Hour, "EURGBP");
eurUsdtsi_ind = Indicators.GetIndicator<TSI>(eurUsd_series.ClosePrices, ShortPeriod, LongPeriod, MaType);
eurGbptsi_ind = Indicators.GetIndicator<TSI>(eurGbp_series.ClosePrices, ShortPeriod, LongPeriod, MaType);
}
public override void Calculate(int index)
{
if (index < 1)
{
eurUsdTsi[index] = 0;
eurGbpTsi[index] = 0;
return;
}
eurUsdTSI[index] = eurUsdtsi_ind.Tsi[eurUsd_series.OpenTimes.GetIndexByTime(Bars.OpenTimes[index])];
eurGbpTSI[index] = eurGbptsi_ind.Tsi[eurGbp_series.OpenTimes.GetIndexByTime(Bars.OpenTimes[index])];
eurUsdTsi[index] = eurUsdTSI[index];
eurGbpTsi[index] = eurGbpTSI[index];
}
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
11 Jun 2020, 08:58
Hi Alex,
Shares are supported in cTrader and many brokers offer shares in their cTrader platforms.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
11 Jun 2020, 08:53
Hi giuseppealessiof,
The reasons that can cause a cBot to stop in backtesting are
1) You manually stop it pressing the Stop button
2) You call the Stop() somewhere in your code
3) An exception occurs.
4) Your account reaches 0 equity.
Points 3 and 4 are obvious from the log and chart respectively. If it is point 1 then you should know about it else check if point 2 is a valid reason anywhere in your code.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
11 Jun 2020, 08:49
Hi Noppanon,
You need to check your email configuration in case something changed.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
11 Jun 2020, 08:47
Hi Sebastian,
If they are still there, it means that the broker did not delete them. You need to talk to your broker to delete them from cTrader.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
11 Jun 2020, 08:44
Hi MZen,
I updated the code on GitHub accordingly. You can take the latest version.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
11 Jun 2020, 08:33
Hi iucpxleps,
When you partially close the position, your flag will be set to true meaning that if you check if the flag is false before the partial closing, the partial closing will only run once. Then it will wait until the MAs cross on the opposite side before resetting to false and allow the partial closing to be executed again.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
11 Jun 2020, 08:30
Hi Lisa,
There is no built-in feature to do this, you need to somehow code this inside your cBot's logic.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
10 Jun 2020, 16:26
Hi MZen,
You can remove it and I will update the code soon.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
10 Jun 2020, 15:49
Hi Ilia,
Yes, you can read more about stop limit orders here.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
12 Jun 2020, 08:22
Hi Ilia,
I am sorry but I do not understand what do you mean. What is a stock exchange glass and a tape of transactions?
Best Regards,
Panagiotis
Join us on Telegram
@PanagiotisCharalampous