
Topics
Replies
PanagiotisCharalampous
06 Oct 2020, 16:45
Hi giovanisgarabotto,
For somebody to help you, you need to share your cBot code and explain what do you need to be changed.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
06 Oct 2020, 14:41
Hi ManInMoon,
Stop outs are used by brokers for their own protection. Traders should never rely on a stop out for protection. They should use stop losses.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
06 Oct 2020, 12:38
Hi snowchilli,
There is no such information in OTC markets so you cannot expect to have this in a CFD platform.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
06 Oct 2020, 12:19
Hi Mason,
If you google for cTrader VWAP indicators, you will find a lot.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
06 Oct 2020, 11:53
Hi Christian,
DeltaClose is not populated for Live trendbars, only for historical ones, since the bar has not closed yet. You should be using the bid price instead.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
06 Oct 2020, 11:05
Hi xabbu,
It cannot get simpler than the link I posted above. Here is again the code sample
using(var reader = new StreamReader(@"C:\test.csv"))
{
List<string> listA = new List<string>();
List<string> listB = new List<string>();
while (!reader.EndOfStream)
{
var line = reader.ReadLine();
var values = line.Split(';');
listA.Add(values[0]);
listB.Add(values[1]);
}
}
You can do it anywhere you want. If you cannot implement it, then maybe you should ask for professional assistance.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
06 Oct 2020, 10:38
Hi xabbu,
I am still not sure what information are you looking for. Can you make your question more specific? If you just want to draw imported values, then just add them to an IndicatorDataSeries and the indicator will do the job for you. Check any of the sample indicators available in cTrader on how to do this.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
06 Oct 2020, 07:39
Hi jayteasuk,
I am not sure what do you mean. Can you please elaborate?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
06 Oct 2020, 07:37
Hi AlgoMaster,
Can you please provide us with the cBot code and parameters file?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
06 Oct 2020, 07:36
Hi Luca,
You need to check if the stop loss was modified again before or not before modifying it. You can use some flags for this.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
05 Oct 2020, 16:51
Hi Tengu,
No there is no such option.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
05 Oct 2020, 14:43
Hi Luca,
Use ModifyTrailingStop.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
05 Oct 2020, 12:38
Hi tradinginsider,
Please send us the application you have downloaded and trying to execute at community@spotware.com so that we can investigate further.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
05 Oct 2020, 10:06
Hi Jay3ast,
Sorry I did not notice that you were referring to cTrader Web. This is available only on the desktop version.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
05 Oct 2020, 09:54
Hi herofus,
Here you go
Indicator Code
using System;
using cAlgo.API;
using cAlgo.API.Internals;
namespace cAlgo.Indicators
{
[Indicator(IsOverlay = true, AccessRights = AccessRights.None)]
public class ZigZag : Indicator
{
[Parameter(DefaultValue = 12)]
public int Depth { get; set; }
[Parameter(DefaultValue = 5)]
public int Deviation { get; set; }
[Parameter(DefaultValue = 3)]
public int BackStep { get; set; }
[Output("ZigZag", Color = Colors.OrangeRed)]
public IndicatorDataSeries Result { get; set; }
#region Private fields
private double _lastLow;
private double _lastHigh;
private double _low;
private double _high;
private int _lastHighIndex;
private int _lastLowIndex;
private int _type;
private double _point;
private double _currentLow;
private double _currentHigh;
public IndicatorDataSeries HighZigZags;
public IndicatorDataSeries LowZigZags;
#endregion
protected override void Initialize()
{
HighZigZags = CreateDataSeries();
LowZigZags = CreateDataSeries();
_point = Symbol.PointSize;
}
public override void Calculate(int index)
{
if (index < Depth)
{
Result[index] = 0;
HighZigZags[index] = 0;
LowZigZags[index] = 0;
return;
}
_currentLow = Functions.Minimum(MarketSeries.Low, Depth);
if (Math.Abs(_currentLow - _lastLow) < double.Epsilon)
_currentLow = 0.0;
else
{
_lastLow = _currentLow;
if ((MarketSeries.Low[index] - _currentLow) > (Deviation * _point))
_currentLow = 0.0;
else
{
for (int i = 1; i <= BackStep; i++)
{
if (Math.Abs(LowZigZags[index - i]) > double.Epsilon && LowZigZags[index - i] > _currentLow)
LowZigZags[index - i] = 0.0;
}
}
}
if (Math.Abs(MarketSeries.Low[index] - _currentLow) < double.Epsilon)
LowZigZags[index] = _currentLow;
else
LowZigZags[index] = 0.0;
_currentHigh = MarketSeries.High.Maximum(Depth);
if (Math.Abs(_currentHigh - _lastHigh) < double.Epsilon)
_currentHigh = 0.0;
else
{
_lastHigh = _currentHigh;
if ((_currentHigh - MarketSeries.High[index]) > (Deviation * _point))
_currentHigh = 0.0;
else
{
for (int i = 1; i <= BackStep; i++)
{
if (Math.Abs(HighZigZags[index - i]) > double.Epsilon && HighZigZags[index - i] < _currentHigh)
HighZigZags[index - i] = 0.0;
}
}
}
if (Math.Abs(MarketSeries.High[index] - _currentHigh) < double.Epsilon)
HighZigZags[index] = _currentHigh;
else
HighZigZags[index] = 0.0;
switch (_type)
{
case 0:
if (Math.Abs(_low - 0) < double.Epsilon && Math.Abs(_high - 0) < double.Epsilon)
{
if (Math.Abs(HighZigZags[index]) > double.Epsilon)
{
_high = MarketSeries.High[index];
_lastHighIndex = index;
_type = -1;
Result[index] = _high;
}
if (Math.Abs(LowZigZags[index]) > double.Epsilon)
{
_low = MarketSeries.Low[index];
_lastLowIndex = index;
_type = 1;
Result[index] = _low;
}
}
break;
case 1:
if (Math.Abs(LowZigZags[index]) > double.Epsilon && LowZigZags[index] < _low && Math.Abs(HighZigZags[index] - 0.0) < double.Epsilon)
{
Result[_lastLowIndex] = double.NaN;
_lastLowIndex = index;
_low = LowZigZags[index];
Result[index] = _low;
}
if (Math.Abs(HighZigZags[index] - 0.0) > double.Epsilon && Math.Abs(LowZigZags[index] - 0.0) < double.Epsilon)
{
_high = HighZigZags[index];
_lastHighIndex = index;
Result[index] = _high;
_type = -1;
}
break;
case -1:
if (Math.Abs(HighZigZags[index]) > double.Epsilon && HighZigZags[index] > _high && Math.Abs(LowZigZags[index] - 0.0) < double.Epsilon)
{
Result[_lastHighIndex] = double.NaN;
_lastHighIndex = index;
_high = HighZigZags[index];
Result[index] = _high;
}
if (Math.Abs(LowZigZags[index]) > double.Epsilon && Math.Abs(HighZigZags[index]) <= double.Epsilon)
{
_low = LowZigZags[index];
_lastLowIndex = index;
Result[index] = _low;
_type = 1;
}
break;
default:
return;
}
}
}
}
cBot code
using cAlgo.API;
using cAlgo.Indicators;
namespace cAlgo.Robots
{
[Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class NewcBot : Robot
{
[Parameter(DefaultValue = 12)]
public int Depth { get; set; }
[Parameter(DefaultValue = 5)]
public int Deviation { get; set; }
[Parameter(DefaultValue = 3)]
public int BackStep { get; set; }
private ZigZag _zigzag;
protected override void OnStart()
{
_zigzag = Indicators.GetIndicator<ZigZag>(Depth, Deviation, BackStep);
}
protected override void OnBar()
{
var result = _zigzag.Result.Last(1);
Print("High: " + _zigzag.HighZigZags.Last(1));
Print("Low: " + _zigzag.LowZigZags.LastValue);
}
protected override void OnStop()
{
// Put your deinitialization logic here
}
}
}
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
05 Oct 2020, 09:00
Hi tradinginsider,
Please try a clean installation of cTrader and let us know if it resolves the problem.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
05 Oct 2020, 08:45
Hi arthur.albert990,
You need to use a DiscontinuousLine plot type.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
05 Oct 2020, 08:42
Hi caglar_G,
There is no fixed time span between ticks.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
05 Oct 2020, 08:39
Hi keno.clayton15,
From what I read is probably not an error but a normal and expected behavior in a live trading environment. Your workaround is probably not just a workaround but the correct way to implement the functionality. I will not bother the devs if I don't confirm it is a bug. If you still want me to have a look, send the code and steps to reproduce the behavior at community@spotware.com.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
07 Oct 2020, 07:55
Hi Mick,
Stop limit orders are not available on FIX API at the moment.
Best Regards,
Panagiotis
Join us on Telegram
@PanagiotisCharalampous