Topics
Replies
PanagiotisCharalampous
14 Oct 2019, 09:25
Hi FireMyst,
Can you please post a complete cBot code the reproduces this issue?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
14 Oct 2019, 09:23
Hi ganatooff1,
This feature is planned for v3.7.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
11 Oct 2019, 15:06
Ηi h.fankhauser828,
Thanks for posting in our forum. This can be automated using cTrader Automate. If you are not familiar with programming, you can post a Job or contact a Consultant to help you with this.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
11 Oct 2019, 11:34
Hi FireMyst
Indicator.Calculate(MarketSeries.Close.Count - 1)
will call your indicator's Calculate function for that specific index
Indicator.Result.Last(0);
Will return the last value of the Result series and call the Calculate function for all required indexes if it hasn't been called yet.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
11 Oct 2019, 11:03
Hi lec0456,
Thanks for spotting this. We will fix it.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
11 Oct 2019, 08:38
( Updated at: 21 Dec 2023, 09:21 )
Hi ctid712216,
See below where this is mentioned in the EULA
and here is where you have accepted this condition
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
10 Oct 2019, 15:59
Hi social.trading,
This tab is available only in cTrader Automate tab.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
10 Oct 2019, 14:52
( Updated at: 21 Dec 2023, 09:21 )
Hi social.trading,
See below. Do you get these entries whenever a dot is drawn on the chart?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
10 Oct 2019, 14:18
Hi ctid712216,
You have been made aware of this by reading and accepting our End User License Agreement. I have quoted above the relevant passage explaining the situation.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
10 Oct 2019, 12:47
Hi social.trading,
UPDATE: Sorry, sceenshot just appeared. Can you send a screenshot of the log as well?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
10 Oct 2019, 12:29
Hi El Antonio,
I don't think this is a bug. Optimization is justa set of multiple backtesting executions with different parameters. These are the settings to be used for each of the backtesting executions of the optimization process.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
10 Oct 2019, 12:22
Hi social.trading
The below seems to work fine for me
using System; using cAlgo.API; using cAlgo.API.Internals; using cAlgo.API.Indicators; using cAlgo.Indicators; namespace cAlgo { [Indicator(IsOverlay = true, AccessRights = AccessRights.FileSystem)] public class LvAMaCross : Indicator { [Parameter("MA Type", DefaultValue = MovingAverageType.TimeSeries)] public MovingAverageType maType { get; set; } [Parameter("Slow Period", DefaultValue = 30, MinValue = 1)] public int slowPeriod { get; set; } [Parameter("Fast Period", DefaultValue = 12, MinValue = 1)] public int fastPeriod { get; set; } [Parameter("Time Frame MA", DefaultValue = "Hour")] public TimeFrame timeFrame { get; set; } [Output("Sell Point", Color = Colors.Red, PlotType = PlotType.Points, Thickness = 15)] public IndicatorDataSeries SellSeries { get; set; } [Output("Buy Point", Color = Colors.Blue, PlotType = PlotType.Points, Thickness = 15)] public IndicatorDataSeries BuySeries { get; set; } public bool alreadyPlayed = false; public IndicatorDataSeries FastDataSeries { get; set; } public IndicatorDataSeries SlowDataSeries { get; set; } //market series cho timeframe cần tính public MarketSeries selectedSeries; public MovingAverage fastMA; public MovingAverage slowMA; int _previousIndex; protected override void Initialize() { FastDataSeries = CreateDataSeries(); SlowDataSeries = CreateDataSeries(); if (timeFrame == MarketSeries.TimeFrame) { selectedSeries = MarketSeries; fastMA = Indicators.MovingAverage(MarketSeries.Close, fastPeriod, maType); slowMA = Indicators.MovingAverage(MarketSeries.Close, slowPeriod, maType); } else { selectedSeries = MarketData.GetSeries(timeFrame); fastMA = Indicators.MovingAverage(selectedSeries.Close, fastPeriod, maType); slowMA = Indicators.MovingAverage(selectedSeries.Close, slowPeriod, maType); } } public override void Calculate(int index) { var selectedIndex = selectedSeries.OpenTime.GetIndexByTime(MarketSeries.OpenTime[index]); if (selectedIndex == -1) { return; } if (selectedIndex != _previousIndex) { _previousIndex = selectedIndex; alreadyPlayed = false; } FastDataSeries[index] = fastMA.Result[selectedIndex]; SlowDataSeries[index] = slowMA.Result[selectedIndex]; if (isCrossBelow()) { // sell SellSeries[index] = MarketSeries.High[index]; if (IsLastBar) { ChartObjects.DrawText("text1", "SELL", StaticPosition.Center, Colors.White); if (!alreadyPlayed) { ChartObjects.DrawText("", "" + alreadyPlayed, StaticPosition.BottomRight, Colors.White); Notifications.PlaySound("C:\\Windows\\Media\\notify.wav"); Print("Play Sell Sound"); alreadyPlayed = true; } } } else if (isCrossAbove()) { // buy BuySeries[index] = MarketSeries.Low[index]; if (IsLastBar) { ChartObjects.DrawText("text1", "BUY", StaticPosition.Center, Colors.White); if (!alreadyPlayed) { ChartObjects.DrawText("", "" + alreadyPlayed, StaticPosition.TopRight, Colors.White); Notifications.PlaySound("C:\\Windows\\Media\\notify.wav"); Print("Play Buy Sound"); alreadyPlayed = true; } } } } #region Predicate public bool isCrossAbove() { return FastDataSeries.HasCrossedAbove(SlowDataSeries, 0); } public bool isCrossBelow() { return FastDataSeries.HasCrossedBelow(SlowDataSeries, 0); } #endregion } }
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
10 Oct 2019, 11:56
Hi Xavier R,
This is a bug. We will fix it in an update.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
10 Oct 2019, 11:46
Hi enam3074,
There are no limitations for the number of symbols at the moment.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
10 Oct 2019, 11:12
Hi social.trading,
Did you check if the specific part of the code is executed? If no, you should investigate the reason. If yes, please make sure that the sound file is in the correct location. It would be better to start with an empty indicator and try to make the sound play on each bar change. After that works successfully, add the functionality to the existing indicator.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
10 Oct 2019, 10:45
Hi social.trading,
The way you have programmed it, it will play the sound only once and then it will stop working. You will need to reset the alreadyPlayed on the change of each bar.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
10 Oct 2019, 09:55
Hi social.trading,
First of all it would be better if you could post the complete cBot code. It is not clear what is the code supposed to do. Then give us a clear explanation of what do you expect the cBot to be doing. Why do you have a loop? Also why do you need to have the sound playing inside the loop?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
10 Oct 2019, 09:02
Hi ctid712216,
As explained above, new orders can be placed automatically to restore the equity to equity ratio between the two accounts. For the specific trade you reported, there was a change in the strategy provider's balance that caused automatic trades to be executed on copying accounts to restore the equity to equity ratio.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
10 Oct 2019, 08:50
Hi social.trading,
The easiest solution to this would be to use a sound file that repeats the sound as many times as you want and just play it from the cBot once.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
14 Oct 2019, 09:29
Hi frank.bellio,
We have plans to add swaps to the Symbol class but we do not have an ETA for this yet.
Best Regards,
Panagiotis
@PanagiotisCharalampous