
Topics
Replies
PanagiotisCharalampous
31 Aug 2018, 10:37
Ηi mathmaia,
Can you post your code so that we can check what the issue is?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
31 Aug 2018, 10:34
Hi
In principle you could have a function that checks if the cBot should be working or not. See below
private bool ShutDown() { if (Server.Time.TimeOfDay >= tradingStarts && Server.Time.TimeOfDay < tradingStops) { return true; } else { return false; } }
You should define the tradingStarts and tradingStops parameters yourself.
Then you can use this function to determine if the cBot should execute its logic or not. See below
protected override void OnTick() { if (!ShutDown()) { //Do something } }
However you will need to customize all the above according to your needs.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
31 Aug 2018, 10:26
Hi myinvestmentsfx,
Yes that would be a feature. You could post it in UserVoice so that we can see the demand and consider it.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
30 Aug 2018, 15:59
Hi Sasha,
Here you go
PendingOrders.Count(x => x.Label == "Certain Label");
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
30 Aug 2018, 15:52
Hi swingfish,
Here it is
// ------------------------------------------------------------------------------------------------- // // This code is a cAlgo API example. // // All changes to this file will be lost on next application start. // If you are going to modify this file please make a copy using the "Duplicate" command. // // ------------------------------------------------------------------------------------------------- using System; using cAlgo.API; using cAlgo.API.Internals; using cAlgo.API.Indicators; using cAlgo.Indicators; namespace cAlgo { [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AutoRescale = false, AccessRights = AccessRights.None)] public class SampleSMA : Indicator { [Parameter("Source")] public DataSeries Source { get; set; } [Parameter(DefaultValue = 14)] public int Periods { get; set; } [Output("Main", Color = Colors.Turquoise)] public IndicatorDataSeries Result { get; set; } public override void Calculate(int index) { double sum = 0.0; for (int i = index - Periods + 1; i <= index; i++) { sum += Source[i]; } Result[index] = sum / Periods; Result[index - 10] = double.NaN; } } }
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
30 Aug 2018, 15:05
Hi myinvestmentsfx,
If you want to join the points with a line you can use Chart.DrawTrendLine() method. However it is just going to be a collection of straight lines rather than a smoothed line used in the case of an indicator.
Best Regards,
@PanagiotisCharalampous
PanagiotisCharalampous
30 Aug 2018, 14:12
Ηι myinvestmentsfx,
It is not possible to use Output attribute in cBots. If you explain to us more precisely what you are trying to do, we could propose a solution.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
29 Aug 2018, 16:47
Hi uvwxyz,
Thanks for the suggestion. You can consider posting it in UserVoice so that it can be considered by the product team. It makes it easier for us to manage suggestions in one place and provide proper feedback rather than being scattered in different forum topics.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
29 Aug 2018, 16:18
Hi courquinpasisa,
You could consider making this class a base class and program all the robots to inherit from it. 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 NewTest : BaseRobot { [Parameter(DefaultValue = 0.0)] public double Parameter { get; set; } public string TextReturn; public Symbol eurUsd; protected override void OnStart() { eurUsd = MarketData.GetSymbol("EURUSD"); order(eurUsd); } protected override void OnTick() { // Put your core logic here } protected override void OnStop() { // Put your deinitialization logic here } } public class BaseRobot : Robot { public BaseRobot() { } public void order(Symbol EU) { ExecuteMarketOrder(TradeType.Buy, EU, 1000); } } }
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
29 Aug 2018, 15:51
Hi Patrick,
Brokers currently offering cMirror will most probably offer cTrader Copy as well. But this has not been finalized yet.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
29 Aug 2018, 15:47
Hi courquinpasisa,
The exception happens for the same reason as before. Why do you need to handle these operations in a separate class?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
29 Aug 2018, 12:44
Hi swingfish,
There is no bulit in way to do so. If you don't want the indicator to be displayed for past periods, you need to empty the IndicatorDataSeries values (set to NaN) for that specific time period.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
29 Aug 2018, 10:08
Hi Sasha,
The new API has not been released to brokers yet. It works only for Spotware cTrader Beta.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
29 Aug 2018, 09:34
Hi tasr1r1,
We reproduced the issue and will be fixed in a future update.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
28 Aug 2018, 15:41
Hi procumulative@gmail.com,
We appreciate that you posted your suggestions. I would encourage you to post them in UserVoice so that they can get voted and considered by the product team. Please check in case they have already been posted first and if yes vote for them. We evaluate the ideas on a frequent basis and we respond on the status of the most popular ideas.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
27 Aug 2018, 12:18
Hi Lavio,
We have reproduced the issue and it will be fixed.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
27 Aug 2018, 12:15
Hi Patrick,
We will change this behavior in one of the next versions.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
27 Aug 2018, 11:42
Hi panudatebeam@gmail.com,
Thanks for posting in our forum. Please try the following
double sto2k = sto_mtf.PercentK.LastValue; double sto2d = sto_mtf.PercentD.LastValue;
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
27 Aug 2018, 11:27
Hi Patrick,
We will check this and come back to you.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
31 Aug 2018, 10:44
Hi Anton,
Here is how
Best Regards,
Panagiotis
@PanagiotisCharalampous