Topics
Replies
PanagiotisCharalampous
10 Oct 2019, 08:41
Hi Aiki1000,
It would be easier for somebody to help you if you posted the relevant source codes as well as some screenshots showing what you are describing.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
10 Oct 2019, 08:36
Hi GlenHendriks,
Either post a link here or send it at community@spotware.com
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
09 Oct 2019, 16:54
Hi ctid1566965,
Yes you need to select the trendline tool for each line you want to draw.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
09 Oct 2019, 16:32
Hi GlenHendriks,
Is it possible to record a short video demonstrating this behavior so that we can have a look?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
09 Oct 2019, 15:31
Hi Be Rich,
There is a fully working example using Open API 2.0 here.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
09 Oct 2019, 12:48
Hi davewilson347,
If you are always getting an exception in these cases, you can always use a try catch statement to handle them.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
09 Oct 2019, 12:31
Hi FireMyst,
First of all if you want to see any results at all you need to change
double tsiDivisor = _divisor.Result[altIndex]; double tsiDividend = _dividend.Result[altIndex];
to
double tsiDivisor = _divisor.Result[index]; double tsiDividend = _dividend.Result[index];
But then there is a major logical issue with your indicator. You are trying to do calculations for indicators using a different timeframe on the main indicator. This will result to wrong results due to different resolution of the available data.
Example
if (MarketSeries.TimeFrame != _marketSeries.TimeFrame) { altIndex = _marketSeries.OpenTime.GetIndexByTime(MarketSeries.OpenTime[index]); }
If MarketSeries.TimeFrame is h1 and _marketSeries.TimeFrame is m30 then when executing the following
_dataSeries[index] = _marketSeries.Close[altIndex] - _marketSeries.Close[altIndex - 1];
The last x values (let's say 14) of _dataSeries will contain sample data from the last 28 values of the _marketSeries.Close, since for every change of the index for h1, the index for m30 increases by 2 (print altIndex to understand what i man). Therefore this average
_longDividend = Indicators.MovingAverage(_dataSeries, 14, MaType);
will not be an average of the last 14 periods but the last 28 since it will average the last 14 sample values collected in _dataSeries.
Since you are using moving averages which are simple to code, it would be easier to do the calculations yourself rather than relying on cTrader indicators. Just loop through the custom timeframe data and calculate the MAs
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
09 Oct 2019, 10:06
Ηι drayzen,
cTrader is a platform for CFD contracts which is a different market in many ways than exchanges. We already have an exchange product called cExchange which has a similar interface to cTrader and it is targeted to cryptocurrency exchanges.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
09 Oct 2019, 08:35
Hi yahuimns,
cTrader Desktop is not available on Mac OS.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
09 Oct 2019, 08:34
Hi FireMyst,
As explained above, data series are not "attached" to any timeframe. It is just a series of doubles. If you want to feed them with data from a lower timeframe, you can do it. There is no time property on anything else that relates an item of the data series to a timeframe.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
09 Oct 2019, 08:20
Hi Stephen,
Thanks for posting in our forum. We do not have a timeframe at the moment.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
09 Oct 2019, 08:14
Hi stereynolds92,
Thanks for posting in our forum. Please use the Suggestions section to post your suggestions.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
08 Oct 2019, 16:57
Hi ciripa,
Your question is irrelevant to the thread. Please create a new thread and I will answer it.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
08 Oct 2019, 16:52
( Updated at: 21 Dec 2023, 09:21 )
Hi Lisa,
Did you use the code I pasted? This is what you are supposed to see.
Is there any way of attaching a colour variable as the line is being drawn rather then needing to reference one of two different lines ?
No this is not possible,
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
08 Oct 2019, 16:45
Hi ctid712216,
We had a look at this issue. The reason behind the "ghost" deal is that there are cases when the equity to equity ratio changes (provider makes withdrawal, copier pays commissions etc) and the system needs to restore the ratio. This was one of these cases. This behavior is clearly explained in our EULA section 11.1.I.D. Quoting the relevant passage below
If you add or remove funds from the Copy Trading Account or the Strategy Provider adds or removes funds from the account used to provide the strategy then positions will be recalculated according to equity to equity ratio.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
08 Oct 2019, 14:59
Hi Chris,
Please send it at community@spotware.com.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
08 Oct 2019, 12:08
Hi Lisa,
You need to use discontinuous lines. See below how
using System; using cAlgo.API; using cAlgo.API.Indicators; using cAlgo.Indicators; // Written by Lisa Beaney - September 2019 // Multiplier added to allow unit changes between brokers to be evened out namespace cAlgo.Indicators { [Levels(0.0)] [Indicator(IsOverlay = false, ScalePrecision = 5, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] public class OsMA : Indicator { [Parameter(DefaultValue = 13)] public int shortCycle { get; set; } [Parameter(DefaultValue = 21)] public int longCycle { get; set; } [Parameter(DefaultValue = 8)] public int signalPeriod { get; set; } [Parameter(DefaultValue = 10000)] public int multiplier { get; set; } [Output("OsMa Line Up Trend", LineColor = "Green", PlotType = PlotType.DiscontinuousLine)] public IndicatorDataSeries ResultUp { get; set; } [Output("OsMa Line Down Trend", LineColor = "Red", PlotType = PlotType.DiscontinuousLine)] public IndicatorDataSeries ResultDown { get; set; } MacdHistogram macd; protected override void Initialize() { macd = Indicators.MacdHistogram(shortCycle, longCycle, signalPeriod); } public override void Calculate(int index) { if ((macd.Signal[index] - macd.Histogram[index]) > (macd.Signal[index - 1] - macd.Histogram[index - 1])) { ResultUp[index] = (macd.Signal[index] - macd.Histogram[index]) * multiplier; ResultDown[index] = double.NaN; if (double.IsNaN(ResultUp[index - 1])) ResultUp[index - 1] = ResultDown[index - 1]; } else { ResultUp[index] = double.NaN; ResultDown[index] = (macd.Signal[index] - macd.Histogram[index]) * multiplier; if (double.IsNaN(ResultDown[index - 1])) ResultDown[index - 1] = ResultUp[index - 1]; } } } }
Let me know if this helps,
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
08 Oct 2019, 09:22
Hi FireMyst,
I am not sure what do you mean with
"I want to "attach" these dataseries to the _marketSeries timeframe, not the current chart's time frame"
DataSeries is not attached to any timeframe, it is just a series of doubles. Can you please elaborate?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
08 Oct 2019, 08:35
Hi to both,
We managed to reproduce this and we will fix it.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
10 Oct 2019, 08:45
Hi RayAdam,
There is no option to disable updates for cTrader.
Best Regards,
Panagiotis
@PanagiotisCharalampous