
Topics
Replies
PanagiotisCharalampous
15 Jan 2018, 10:40
Hi irmscher9,
The answer to your question is no the backtesting data start date is not moving forward with time. The availabilty of backtesting tick and trend bar data is related to the amount of availability historical data provided by your broker.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
12 Jan 2018, 17:16
Hi oneplusoc,
This happens because of the scale of the chart. If you want to combine the two indicators, you will have this problem. Momentum oscillator usually oscillates around 100.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
12 Jan 2018, 16:44
Dear oneplusoc,
See a corrected version below
using System; using cAlgo.API; using cAlgo.API.Internals; using cAlgo.API.Indicators; using cAlgo.Indicators; namespace cAlgo { [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] public class NewIndicator : Indicator { [Parameter(DefaultValue = 0.0)] public double Parameter { get; set; } [Output("RSI", Color = Colors.Blue)] public IndicatorDataSeries RSI { get; set; } [Output("Momentum", Color = Colors.Green)] public IndicatorDataSeries Momentum { get; set; } private RelativeStrengthIndex _rsi; private MomentumOscillator _momentum; protected override void Initialize() { _rsi = Indicators.RelativeStrengthIndex(MarketSeries.Close, 14); _momentum = Indicators.MomentumOscillator(MarketSeries.Close, 14); } public override void Calculate(int index) { RSI[index] = _rsi.Result[index]; Momentum[index] = _momentum.Result[index]; } } }
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
12 Jan 2018, 11:59
Hi oneplusoc,
The solution is to create a custom indicator that combines the two indicators together. See a relevant discussion here.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
12 Jan 2018, 11:50
Hi Drummond360,
It is better to put the information in the forum so that other community members can contribute as well and the possible solutions are kept for future reference.
However I understand that you might not want to expose your work to everybody. If this is the case then fill free to contact me at community at spotware dot com.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
12 Jan 2018, 11:42
Hi oneplusoc,
See below
using System; using cAlgo.API; using cAlgo.API.Indicators; using cAlgo.API.Internals; namespace cAlgo.Indicators { [Levels(30, 70, 80, 50, 20)] [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC)] public class aarsiforall : Indicator { private RelativeStrengthIndex ma1; private MarketSeries series1; private Symbol symbol1; [Parameter(DefaultValue = "AUDUSD")] public string Symbol1 { get; set; } [Parameter(DefaultValue = 14)] public int Period { get; set; } [Output("MA Symbol 1", Color = Colors.Red, PlotType = PlotType.Line, Thickness = 1)] public IndicatorDataSeries Result1 { get; set; } protected override void Initialize() { symbol1 = MarketData.GetSymbol(Symbol1); series1 = MarketData.GetSeries(symbol1, TimeFrame); ma1 = Indicators.RelativeStrengthIndex(series1.Close, Period); } public override void Calculate(int index) { ShowOutput(symbol1, Result1, ma1, series1, index); } private void ShowOutput(Symbol symbol, IndicatorDataSeries result, RelativeStrengthIndex RelativeStrengthIndex, MarketSeries series, int index) { int index2 = GetIndexByDate(series, MarketSeries.OpenTime[index]); result[index] = RelativeStrengthIndex.Result[index2]; string text = string.Format("{0} {1}", symbol.Code, Math.Round(result[index], 0)); ChartObjects.DrawText(symbol.Code, text, index + 1, result[index], VerticalAlignment.Center, HorizontalAlignment.Right, Colors.Yellow); } private int GetIndexByDate(MarketSeries series, DateTime time) { for (int i = series.Close.Count - 1; i >= 0; i--) if (time == series.OpenTime[i]) return i; return -1; } } }
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
12 Jan 2018, 10:57
Hi Drummond360,
The provided information is not enough for us to reach to a conclusion. We need to understand why you expected that the trade should lock in a profit. In order to be able to investigate this, we will all the necessary information to be able to run the backtesting ourselves. So we need
- The full cBot code.
- The cBot's initial parameters.
- All the backtesting parameters.
- The trade that you believe should be profitable.
If you send us the above, we can have a look and advise further.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
11 Jan 2018, 14:58
Hi irmscher9,
The problem with your indicator was that you were not using the correct indexes for the h2 series. The GetIndexByExactTime() function allows you to get the index for a specified MarketSeries based purely on time, which is a common reference between MarketSeries of different timeframes. Let me know if my explanation helps you.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
11 Jan 2018, 10:11
Hi irmscher9,
Can you please try the version below and let me know if it works for you?
using System; using cAlgo.API; using cAlgo.API.Internals; using cAlgo.API.Indicators; using cAlgo.Indicators; namespace cAlgo.Indicators { [Indicator("High Minus Low", IsOverlay = true, TimeZone = TimeZones.UTC, AutoRescale = false, AccessRights = AccessRights.None)] public class HighMinusLow : Indicator { [Output("Main", Color = Colors.Orange)] public IndicatorDataSeries Result { get; set; } [Parameter(DefaultValue = 14)] public int Periods { get; set; } [Output("Upper", Color = Colors.Aquamarine)] public IndicatorDataSeries Upper { get; set; } [Output("Lower", Color = Colors.Aquamarine)] public IndicatorDataSeries Lower { get; set; } private MarketSeries h2; protected override void Initialize() { h2 = MarketData.GetSeries(TimeFrame.Hour2); //ma5 = Indicators.MovingAverage(h2.Close Period, MovingAverageType.Triangular); } public override void Calculate(int index) { double open = h2.Open[h2.OpenTime.GetIndexByExactTime(MarketSeries.OpenTime[index])]; double close = h2.Close[h2.OpenTime.GetIndexByExactTime(MarketSeries.OpenTime[index])]; Upper[index] = open; Lower[index] = close; } } }
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
11 Jan 2018, 09:44
Hi Drummond360,
Can you please post the full cBot code so that we can check it? Also let us know on which broker you run this cBot.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
11 Jan 2018, 09:40
Hi ogima.515@gmail.com,
Can you please send us a screenshot with the parameters you are trying to use?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
09 Jan 2018, 14:59
Hi jalmir.coelho@gmail.com,
Have a look at History collection. You can loop through it and get all the necessary information of past trades.
Let me know if this helps you.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
08 Jan 2018, 11:44
Hi megha,
Can you please provide us with more information about your problem e.g. a screenshot or a video? Does it still happen was it something temporary?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
08 Jan 2018, 11:11
Hi ngocnguyen.uon,
There is no built in way to do this but you can combine the two indicators in a custom one. See a code example below
using System; using cAlgo.API; using cAlgo.API.Internals; using cAlgo.API.Indicators; using cAlgo.Indicators; namespace cAlgo { [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] public class NewIndicator : Indicator { [Parameter(DefaultValue = 0.0)] public double Parameter { get; set; } [Output("RSI", Color = Colors.Blue)] public IndicatorDataSeries Result { get; set; } [Output("K", Color = Colors.Green)] public IndicatorDataSeries K { get; set; } [Output("D", Color = Colors.Red)] public IndicatorDataSeries D { get; set; } private RelativeStrengthIndex _rsi; private StochasticOscillator _stochasticOscillator; protected override void Initialize() { _rsi = Indicators.RelativeStrengthIndex(MarketSeries.High, 14); _stochasticOscillator = Indicators.StochasticOscillator(9, 3, 9, MovingAverageType.Simple); } public override void Calculate(int index) { Result[index] = _rsi.Result[index]; K[index] = _stochasticOscillator.PercentK[index]; D[index] = _stochasticOscillator.PercentD[index]; } } }
Let me know if this helps
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
08 Jan 2018, 10:28
( Updated at: 21 Dec 2023, 09:20 )
Hi jalmir.coelho@gmail.com,
cBots are built without source code by default. See image below
Therefore if you distribute your .calgo file and you have not use "Build with Source Code" option, then the code will not be available.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
08 Jan 2018, 10:10
Hi aronbara9,
Thanks for posting in our forum. You can listen to the Positions Opened and Closed events.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
08 Jan 2018, 10:00
Hi swingfish,
If you post your custom indicator then maybe somebody from the community could suggest a solution to your problem.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
05 Jan 2018, 17:25
Hi pooya.kadkhodaee,
We have started rolling out the new native mobile apps to brokers. However, because deployments are dependent on many factors, not all brokers will get the new apps at the same time. But hopefully all brokers should have the new apps soon.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
05 Jan 2018, 15:43
Hi megha,
Please try the solution described here.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
15 Jan 2018, 10:58
Hi dordkash@gmail.com,
Thanks for reporting this issue. Can you please tell us if you took any specific action for this to happen and if you can consistently reproduce it? When it happens again then I advise you to send some troubleshooting information to our Quality Assurance team. You can achieve that by pressing Ctrl+Alt+Shift+T and then pressing the "Submit" button on the form that will pop up. In the message area please paste a link of this discussion as well so that the QA team can associate the report with the issue.
Best Regards,
Panagiotis
@PanagiotisCharalampous