
Topics
Replies
PanagiotisChar
17 Oct 2022, 11:39
Hi mihaiandreana,
No because then it not a limit order as you will be buying or selling at worse prices than the limit. You could program a cBot that sends market orders triggered by the bid price.
Need help? Join us on Telegram
Need premium support? Trade with us
@PanagiotisChar
PanagiotisChar
17 Oct 2022, 11:11
Hi drewisdad,
You can use reflection to get the parameters of a class.
Need help? Join us on Telegram
Need premium support? Trade with us
@PanagiotisChar
PanagiotisChar
17 Oct 2022, 10:56
Hi Paolo,
If you share the complete cBot code, I am happy to have a look and let you know what is wrong with your code.
Need help? Join us on Telegram
Need premium support? Trade with us
@PanagiotisChar
PanagiotisChar
17 Oct 2022, 10:54
Hi Jens,
Everything works fine, the problem is in your logic. On bar change, open and close prices are always the same, therefore the following condition will be always false and the result value will be always 0
if (Bars.ClosePrices[index] > Bars.OpenPrices[index]) // green bar
Result[index] = value1;
else
Result[index] = value0;
If you change OnBar to the below, you will start seeing green lines
protected override void OnBar()
{
int BarIndex;
ChartVerticalLine myLine;
string drawnName;
Print(myDemoIndicator.Result.Last(1));
if (myDemoIndicator.Result.Last(1) == DemoIndicator.value1)
{
BarIndex = Bars.Count - 1; // index starts at 0
drawnName = "Line" + BarIndex.ToString();
myLine = Chart.DrawVerticalLine(drawnName, BarIndex, Color.LimeGreen, 2, LineStyle.Solid);
myLine.IsInteractive = (IsBacktesting == true); // if not set as interactive it will be deleted after end of backtesting. https://ctrader.com/forum/calgo-support/16649
}
}
Need help? Join us on Telegram
Need premium support? Trade with us
@PanagiotisChar
PanagiotisChar
17 Oct 2022, 10:36
Hi drewisdad,
Now the argument has two collections instead, ObjectsAddedToSelection and ObjectsRemovedFromSelection.
Need help? Join us on Telegram
Need premium support? Trade with us
@PanagiotisChar
PanagiotisChar
15 Oct 2022, 10:13
Hi there,
If you need professional help with this, reach out to me at development@clickalgo.com.
Need help? Join us on Telegram
Need premium support? Trade with us
@PanagiotisChar
PanagiotisChar
14 Oct 2022, 15:13
Hi there,
If you need to hire somebody for this, feel free to reach out to me at development@clickalgo.com.
Need help? Join us on Telegram
Need premium support? Trade with us
@PanagiotisChar
PanagiotisChar
14 Oct 2022, 07:16
Hi there,
If you need somebody to develop this for you, contact us at development@clickalgo.com
Need help? Join us on Telegram
Need premium support? Trade with us
@PanagiotisChar
PanagiotisChar
13 Oct 2022, 14:36
Hi firemyst,
I cannot think of an accurate way to do so without tick data.
Need help? Join us on Telegram
Need premium support? Trade with us
@PanagiotisChar
PanagiotisChar
13 Oct 2022, 08:54
Hi there,
Do you run this on any virtualization technology? Try setting AccessRights to FullAccess.
Need help? Join us on Telegram
Need premium support? Trade with us
@PanagiotisChar
PanagiotisChar
13 Oct 2022, 07:49
My friends at Spotware added some cool guides
Enjoy!
Need help? Join us on Telegram
Need premium support? Trade with us
@PanagiotisChar
PanagiotisChar
13 Oct 2022, 07:42
( Updated at: 13 Oct 2022, 07:45 )
Hi Yuval,
Is there a way to set the bands color by code?
Unfortunately this is not possible.
Is there a way at least to set the default color value?
Yes see below
[Output("Main", LineColor = "Red")]
Need help? Join us on Telegram
Need premium support? Trade with us
@PanagiotisChar
PanagiotisChar
12 Oct 2022, 08:22
Hi there,
An easier option is the below
Positions.Count(x => x.SymbolName == SymbolName)
Need help? Join us on Telegram
Need premium support? Trade with us
@PanagiotisChar
PanagiotisChar
10 Oct 2022, 16:38
Weird,
Looks good on my side
https://pcharalampous-spotware.tinytake.com/msc/NzQzOTEwMl8yMDM0MDMxMg
@PanagiotisChar
PanagiotisChar
10 Oct 2022, 09:17
Hi PioneeringDavy,
I don't think this will happen any time soon.
@PanagiotisChar
PanagiotisChar
10 Oct 2022, 09:16
Hi Yuval,
Here is a starting point
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using cAlgo.API;
using cAlgo.API.Collections;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
namespace cAlgo
{
[Indicator(AccessRights = AccessRights.None, IsOverlay = true)]
public class NewIndicator : Indicator
{
[Output("Main")]
public IndicatorDataSeries Main { get; set; }
[Output("Top")]
public IndicatorDataSeries Top { get; set; }
[Output("Bottom")]
public IndicatorDataSeries Bottom { get; set; }
BollingerBands _bb;
protected override void Initialize()
{
_bb = Indicators.BollingerBands(Bars.ClosePrices, 20, 2, MovingAverageType.Simple);
}
public override void Calculate(int index)
{
// Calculate value at specified index
Main[index] = _bb.Main[index];
Top[index] = _bb.Top[index];
Bottom[index] = _bb.Bottom[index];
}
}
}
@PanagiotisChar
PanagiotisChar
10 Oct 2022, 09:09
Hi Yuval,
Backtesting data is stored in C:\Users\username\AppData\Roaming\broker cTrader\BacktestingCache
@PanagiotisChar
PanagiotisChar
07 Oct 2022, 16:42
Hi there,
I don't work for Spotware and I also tried the tool on 4.4.13 which seems to work fine for me. Maybe record a video and share it in the indicator's comments so that the developer can see it and fix it.
@PanagiotisChar
PanagiotisChar
17 Oct 2022, 13:37
Hi there,
Swaps are not available in the API at the moment unfortunately. So you would need to add them manually as parameters and consider them in your calculation.
Aieden Technologies
Need help? Join us on Telegram
Need premium support? Trade with us
@PanagiotisChar