
Topics
Replies
PanagiotisCharalampous
04 Mar 2019, 11:19
Hi Ron77,
If both brokers offer cTrader Copy/cMirror. you can use them as well.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
04 Mar 2019, 11:15
Hi a.fernandez.martinez,
Yes it is. You can read more here.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
04 Mar 2019, 11:13
Hi MZen,
You cannot get rid of the message.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
04 Mar 2019, 11:08
Hi a.fernandez.martinez,
See below how to do this
foreach (var obj in Chart.Objects) { if (obj is ChartHorizontalLine) { var price = (obj as ChartHorizontalLine).Y; } }
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
04 Mar 2019, 10:50
Hi Ton,
It is still not clear to me. What do you mean when you say an instance is not found? Is this a message you get somewhere? Who is your broker? Where can I see these symbols? How can I reproduce this on my pc?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
04 Mar 2019, 10:42
Hi Noblemonde,
Thanks for posting in our forum and for your positive feedback. You should expect more features on the mobile applications in the upcoming updates. We are planning to speed up the release cycle and deliver a new version every one to two months.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
04 Mar 2019, 10:37
Hi Ben,
Trend lines are for this purpose. Why do you say that it is hard to draw precicely enough?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
04 Mar 2019, 10:36
Hi Sasha,
See below
protected override void OnStart() { Positions.Closed += Positions_Closed; } private void Positions_Closed(PositionClosedEventArgs obj) { if (obj.Reason == PositionCloseReason.TakeProfit) { // Execute market order } }
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
04 Mar 2019, 10:35
Hi tmfd,
Without any commitments, we hope to have this during first half of 2019.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
04 Mar 2019, 10:32
Hi Jeziel,
Check the code below
using System; using cAlgo.API; using cAlgo.API.Internals; using cAlgo.API.Indicators; using cAlgo.Indicators; using System.Linq; namespace cAlgo { [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AutoRescale = true, AccessRights = AccessRights.None)] public class SistemaImpulsoVersionEstable : Indicator { public MacdHistogram MacdHistogram; [Parameter()] public DataSeries Source { get; set; } [Parameter("Long Cycle", DefaultValue = 26)] public int LongCycle { get; set; } [Parameter("Short Cycle", DefaultValue = 12)] public int ShortCycle { get; set; } [Parameter("Signal Periods", DefaultValue = 9)] public int Periods { get; set; } [Parameter("Ema Period", DefaultValue = 13, MinValue = 1)] public int EmaPeriod { get; set; } private ExponentialMovingAverage Ema { get; set; } [Parameter("Above up color", DefaultValue = "DarkGreen")] public string AboveDownColor { get; set; } [Parameter("Above up color", DefaultValue = "DarkGreen")] public string AboveUpColor { get; set; } [Parameter("Above up color 2", DefaultValue = "Lime")] public string AboveDownColor2 { get; set; } [Parameter("Above up color 2", DefaultValue = "Lime")] public string AboveUpColor2 { get; set; } [Parameter("Below up color", DefaultValue = "DarkRed")] public string BelowUpColor { get; set; } [Parameter("Below down color", DefaultValue = "DarkRed")] public string BelowDownColor { get; set; } [Parameter("Below up color 2", DefaultValue = "OrangeRed")] public string BelowUpColor2 { get; set; } [Parameter("Below down color 2", DefaultValue = "OrangeRed")] public string BelowDownColor2 { get; set; } [Parameter("Neutral up color", DefaultValue = "Gray")] public string NeutralUpColor { get; set; } [Parameter("Neutral down color", DefaultValue = "Gray")] public string NeutralDownColor { get; set; } private Colors _AboveUpColor; private Colors _AboveDownColor; private Colors _AboveUpColor2; private Colors _AboveDownColor2; private Colors _BelowUpColor; private Colors _BelowDownColor; private Colors _BelowUpColor2; private Colors _BelowDownColor2; private Colors _NeutralUpColor; private Colors _NeutralDownColor; private Colors color; private bool _incorrectColors; private Random _random = new Random(); /*------ SMA 200-----------*/ public int Ema200 = 200; private MovingAverage ma200; /*------FIN SMA 200-----------*/ protected override void Initialize() { MacdHistogram = Indicators.MacdHistogram(Source, LongCycle, ShortCycle, Periods); Ema = Indicators.ExponentialMovingAverage(Source, EmaPeriod); ma200 = Indicators.SimpleMovingAverage(Source, Ema200); if (!Enum.TryParse<Colors>(AboveUpColor, out _AboveUpColor) || !Enum.TryParse<Colors>(AboveDownColor, out _AboveDownColor) || !Enum.TryParse<Colors>(BelowUpColor, out _BelowUpColor) || !Enum.TryParse<Colors>(BelowDownColor, out _BelowDownColor) || !Enum.TryParse<Colors>(NeutralUpColor, out _NeutralUpColor) || !Enum.TryParse<Colors>(NeutralDownColor, out _NeutralDownColor) || !Enum.TryParse<Colors>(AboveUpColor2, out _AboveUpColor2) || !Enum.TryParse<Colors>(AboveDownColor2, out _AboveDownColor2) || !Enum.TryParse<Colors>(BelowUpColor2, out _BelowUpColor2) || !Enum.TryParse<Colors>(BelowDownColor2, out _BelowDownColor2)) { _incorrectColors = true; } Chart.ZoomChanged += Chart_ZoomChanged; } private void Chart_ZoomChanged(ChartZoomEventArgs obj) { Print("Zoom Changed"); for (int i = 0; i < MarketSeries.Close.Count; i++) { Refresh(i); } } public void Refresh(int index) { // This update the Candlewidth Variable according to the ZoomChart Value int CandleWidth = 1; switch (Chart.Zoom) { case 0: { CandleWidth = 1; break; } case 1: { CandleWidth = 1; break; } case 2: { CandleWidth = 3; break; } case 3: { CandleWidth = 5; break; } case 4: { CandleWidth = 11; break; } case 5: { CandleWidth = 25; break; } } // This update de color of the color variable according to its condition var open = MarketSeries.Open[index]; var high = MarketSeries.High[index]; var low = MarketSeries.Low[index]; var close = MarketSeries.Close[index]; if (MacdHistogram.Histogram.IsRising() && Ema.Result.IsRising() && MacdHistogram.Histogram.LastValue < 0) { color = open > close ? _AboveDownColor : _AboveUpColor; } if (MacdHistogram.Histogram.IsRising() && Ema.Result.IsRising() && MacdHistogram.Histogram.LastValue > 0) { color = open > close ? _AboveDownColor2 : _AboveUpColor2; } if (MacdHistogram.Histogram.IsFalling() && Ema.Result.IsFalling() && MacdHistogram.Histogram.LastValue > 0) { color = open > close ? _BelowDownColor : _BelowUpColor; } if (MacdHistogram.Histogram.IsFalling() && Ema.Result.IsFalling() && MacdHistogram.Histogram.LastValue < 0) { color = open > close ? _BelowDownColor2 : _BelowUpColor2; } if (MacdHistogram.Histogram.IsRising() && Ema.Result.IsFalling() || MacdHistogram.Histogram.IsFalling() && Ema.Result.IsRising()) { color = open > close ? _NeutralDownColor : _NeutralUpColor; } //Here is printed on the Chart and the CandleWidth take the last value in the switch Chart.DrawTrendLine("candle" + index, index, open, index, close, (Chart.Objects.First(x => x.Name == "candle" + index) as ChartTrendLine).Color, CandleWidth, LineStyle.Solid); Chart.DrawTrendLine("line" + index, index, high, index, low, (Chart.Objects.First(x => x.Name == "line" + index) as ChartTrendLine).Color, 1, LineStyle.Solid); } public override void Calculate(int index) { // This update the Candlewidth Variable according to the ZoomChart Value int CandleWidth = 1; switch (Chart.Zoom) { case 0: { CandleWidth = 1; break; } case 1: { CandleWidth = 1; break; } case 2: { CandleWidth = 3; break; } case 3: { CandleWidth = 5; break; } case 4: { CandleWidth = 11; break; } case 5: { CandleWidth = 25; break; } } // This update de color of the color variable according to its condition var open = MarketSeries.Open[index]; var high = MarketSeries.High[index]; var low = MarketSeries.Low[index]; var close = MarketSeries.Close[index]; if (MacdHistogram.Histogram.IsRising() && Ema.Result.IsRising() && MacdHistogram.Histogram.LastValue < 0) { color = open > close ? _AboveDownColor : _AboveUpColor; } if (MacdHistogram.Histogram.IsRising() && Ema.Result.IsRising() && MacdHistogram.Histogram.LastValue > 0) { color = open > close ? _AboveDownColor2 : _AboveUpColor2; } if (MacdHistogram.Histogram.IsFalling() && Ema.Result.IsFalling() && MacdHistogram.Histogram.LastValue > 0) { color = open > close ? _BelowDownColor : _BelowUpColor; } if (MacdHistogram.Histogram.IsFalling() && Ema.Result.IsFalling() && MacdHistogram.Histogram.LastValue < 0) { color = open > close ? _BelowDownColor2 : _BelowUpColor2; } if (MacdHistogram.Histogram.IsRising() && Ema.Result.IsFalling() || MacdHistogram.Histogram.IsFalling() && Ema.Result.IsRising()) { color = open > close ? _NeutralDownColor : _NeutralUpColor; } //Here is printed on the Chart and the CandleWidth take the last value in the switch ChartObjects.DrawLine("candle" + index, index, open, index, close, color, CandleWidth, LineStyle.Solid); ChartObjects.DrawLine("line" + index, index, high, index, low, color, 1, LineStyle.Solid); } } }
Let me know if this works for you
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
01 Mar 2019, 14:45
Hi Glen,
Thanks I have seen the video. Your description was a bit confusing. The objects do not stay on the list for any chart and any symbol. The drawings stay on the list only when you change symbol on the same chart. The chart objects/indicators apply to the chart itself and not to a chart/symbol combination. If you need a clean chart and a separate set of chart objects/indicators, you can create a new chart.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
01 Mar 2019, 14:27
Hi Ben,
Not really :) Can we arrange a TeamViewer session so that our QA team can inspect your computer?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
01 Mar 2019, 14:14
Hi ryan.a.blake,
When you have time, please share backtesting parameters and results. I need to be able to reproduce exactly what you can see in cTrader.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
01 Mar 2019, 12:42
Hi Glen,
Send it to community@spotware.com
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
01 Mar 2019, 12:12
Hi Ton,
The issue is not very clear to me. Can you give me exact steps to reproduce it and understand what you mean?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
01 Mar 2019, 12:10
Hi Ton,
Immediatelly means on the existing liquidity. If the existing liquidity at the time of filling the order is not adequate to fill the order, then the order not filled is cancelled. It will not wait for new liquidity. Investopedia is a good resource for such definitions.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
01 Mar 2019, 11:34
Hi Ben,
When you say nothing happens, do you mean there are no errors or cTrader does not launch? If cTrader does not launch then this is because you probably try to run it from a short cut. To launch cTrader as an admininstrator, you need to find the actual folder and run it from there.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
01 Mar 2019, 11:19
Hi Jeziel,
Thanks for posting in our forum. To solve the problem, you need to handle the zoom changing event and redraw your indicator. See below
protected override void Initialize() { MacdHistogram = Indicators.MacdHistogram(Source, LongCycle, ShortCycle, Periods); Ema = Indicators.ExponentialMovingAverage(Source, EmaPeriod); ma200 = Indicators.SimpleMovingAverage(Source, Ema200); if (!Enum.TryParse<Colors>(AboveUpColor, out _AboveUpColor) || !Enum.TryParse<Colors>(AboveDownColor, out _AboveDownColor) || !Enum.TryParse<Colors>(BelowUpColor, out _BelowUpColor) || !Enum.TryParse<Colors>(BelowDownColor, out _BelowDownColor) || !Enum.TryParse<Colors>(NeutralUpColor, out _NeutralUpColor) || !Enum.TryParse<Colors>(NeutralDownColor, out _NeutralDownColor) || !Enum.TryParse<Colors>(AboveUpColor2, out _AboveUpColor2) || !Enum.TryParse<Colors>(AboveDownColor2, out _AboveDownColor2) || !Enum.TryParse<Colors>(BelowUpColor2, out _BelowUpColor2) || !Enum.TryParse<Colors>(BelowDownColor2, out _BelowDownColor2)) { _incorrectColors = true; } Chart.ZoomChanged += Chart_ZoomChanged; } private void Chart_ZoomChanged(ChartZoomEventArgs obj) { //Redraw your indicator }
Let me know if this helps
Best Regards.
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
01 Mar 2019, 10:36
Hi rooky06,
Can you explain what does this screener do?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
04 Mar 2019, 11:25
Hi Ivan,
This is not possible at the moment for instances belonging to the same broker's cTrader.
Best Regards,
Panagiotis
@PanagiotisCharalampous