
Topics
Replies
PanagiotisCharalampous
20 Dec 2019, 12:40
Hi terminal-motors,
If you enable trailing stop loss, then the stop loss will start trailing the price at the stop loss distance.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
20 Dec 2019, 12:33
Hi terminal-motors,
These questions need to be addressed to Roboforex. It is the broker's choice which integrations will be added to their platform and which symbols will be offered.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
20 Dec 2019, 12:10
Hi VFX Managing Trader,
This is not an error, it is by design. It needs to work like this when strategy providers make deposits and withdrawals to the strategy account. However we understand that some strategy providers do not want their fees to be deposited into their strategy account so we will enable this option.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
20 Dec 2019, 11:59
Hi VFX Managing Trader,
We have investigated your issue. The buy closing deals on the follower's account are caused by a change in equity to equity ratio on the strategy provider's account due to commissions being deposited to the strategy account. Therefore the follower's account is adjusted to have the same equity to equity ratio as the strategy provider by partially closing some deals. This can happen and it is explained in our EULA in 11.1.I.D.
In future versions of cTrader Copy, we plan to allow strategy providers to receive commissions in separate accounts so that the equity to equity ratio is not affected and these partial closings do not happen.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
20 Dec 2019, 11:37
Hi mpistorius,
Thanks for reporting this issue. It is a known issue with Spotware cTrader Beta 3.7 and it will be resolved in an upcoming update.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
20 Dec 2019, 11:18
Hi velu130486,
As I explained above, if you need help with custom development, you can consider posting a Job or contacting a Consultant to develop your cBot.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
20 Dec 2019, 10:21
Hi VFX Managing Trader,
Are you sure that the follower's deals you posted correspond to the strategy provider's deals? If yes, please provide us with the strategy name and broker of the strategy provider, the account number and broker of the follower so that we can have a look.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
20 Dec 2019, 08:19
Hi tgjobscv,
We do not support this scenario so it will not be a part of our testing procedure. If you try it, let us know how it goes.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
20 Dec 2019, 08:12
Hi Collins,
You can try using and modifying a Zig Zag indicator that detects highs and lows. You can find some below
https://ctrader.com/algos/indicators/show/157
https://ctrader.com/algos/indicators/show/1218
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
19 Dec 2019, 10:08
Hi lec0456,
No there will be no such option.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
19 Dec 2019, 08:58
Hi FireMyst,
This indicator is available for download for free, so we do not have plans to add it as a built-in indicator.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
19 Dec 2019, 08:29
Hi FireMyst,
As far as I know it is the close price which is considering only the bid price.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
18 Dec 2019, 08:45
Hi 8089669,
Please use the Suggestions section for posting your suggestions.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
17 Dec 2019, 16:28
Hi mr.polax.troy,
See below the answers to your questions
- I assume you refer to cTrader Automate. At the moment you cannot display indicators on the chart via cTrader Automate API.
- Most indicators have a source option. You can pass a source from another timeframe which you can get using MarketData.GetSeries() method.
- There is no such option at the moment.
- As explained in point 1, there is no such option. You will need to add the indicators manually.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
17 Dec 2019, 15:44
Hi v,kredov,
The way you handle indices between different data series is wrong. An index in calculate is not the same index in a series retrieved by GetBars(). See below a corrected version
using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;
using System.Threading;
using System.Collections.Generic;
namespace cAlgo
{
[Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None, ScalePrecision = 5, AutoRescale = true)]
public class Correlation : Indicator
{
[Parameter("Master Currency", DefaultValue = "EURUSD")]
public string masterName { get; set; }
[Parameter("Slave Currency", DefaultValue = "AUDUSD")]
public string slaveName { get; set; }
[Parameter("Periods", DefaultValue = 120)]
public int Period { get; set; }
[Output("Correlation", LineColor = "Red")]
public IndicatorDataSeries Result { get; set; }
private Bars masterBars;
private Bars slaveBars;
private Symbol masterSymbol;
private Symbol slaveSymbol;
protected override void Initialize()
{
masterSymbol = Symbols.GetSymbol(masterName);
slaveSymbol = Symbols.GetSymbol(slaveName);
masterBars = MarketData.GetBars(Bars.TimeFrame, masterName);
slaveBars = MarketData.GetBars(Bars.TimeFrame, slaveName);
while (masterBars.Count < Period)
{
var loadedCount = masterBars.LoadMoreHistory();
if (loadedCount == 0)
break;
}
while (slaveBars.Count < Period)
{
var loadedCount = slaveBars.LoadMoreHistory();
if (loadedCount == 0)
break;
}
}
public override void Calculate(int index)
{
if (index < Period + 1)
{
return;
}
double masterSum = 0;
double masterMedian = 0;
double slaveSum = 0;
double slaveMedian = 0;
double upPartSum = 0;
double masterDeltaSqrtSum = 0;
double slaveDeltaSqrtSum = 0;
for (int i = 0; i < Period; i++)
{
var masterBarsIndex = masterBars.OpenTimes.GetIndexByTime(Bars.OpenTimes[index]) - i;
if (!double.IsNaN(masterBarsIndex))
masterSum = masterSum + masterBars[masterBarsIndex].Close;
var slaveBarsIndex = slaveBars.OpenTimes.GetIndexByTime(Bars.OpenTimes[index]) - i;
if (!double.IsNaN(slaveBarsIndex) && slaveBarsIndex >= 0 && slaveBars.Count > slaveBarsIndex)
slaveSum = slaveBars[slaveBarsIndex].Close;
}
masterMedian = masterSum / Period;
slaveMedian = slaveSum / Period;
for (int i = 0; i < Period; i++)
{
upPartSum = upPartSum + (masterBars[masterBars.OpenTimes.GetIndexByTime(Bars.OpenTimes[index]) - i].Close - masterMedian) * (slaveBars[slaveBars.OpenTimes.GetIndexByTime(Bars.OpenTimes[index]) - i].Close - slaveMedian);
masterDeltaSqrtSum = masterDeltaSqrtSum + Math.Pow(masterBars[masterBars.OpenTimes.GetIndexByTime(Bars.OpenTimes[index]) - i].Close - masterMedian, 2);
slaveDeltaSqrtSum = slaveDeltaSqrtSum + Math.Pow(slaveBars[slaveBars.OpenTimes.GetIndexByTime(Bars.OpenTimes[index]) - i].Close - slaveMedian, 2);
}
Result[index] = upPartSum / Math.Sqrt(masterDeltaSqrtSum * slaveDeltaSqrtSum);
}
}
}
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
17 Dec 2019, 08:15
( Updated at: 21 Dec 2023, 09:21 )
Hi M K,
I assume you are using 3.7
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
16 Dec 2019, 14:59
( Updated at: 21 Dec 2023, 09:21 )
Hi M K,
As I said I have tried this cBot but I do not see any issues. See below an example from GBPUSD t1
Am I missing something?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
16 Dec 2019, 14:50
RE:
Hi useretinv,
See an example below with the cBot trading on two symbols.
using System;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;
namespace cAlgo.Robots
{
[Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class marto : Robot
{
[Parameter("Initial Volume", DefaultValue = 10000, MinValue = 0)]
public int InitialVolume { get; set; }
[Parameter("Stop Loss", DefaultValue = 40)]
public int StopLoss { get; set; }
[Parameter("Take Profit", DefaultValue = 40)]
public int TakeProfit { get; set; }
private Random random = new Random();
protected override void OnStart()
{
Positions.Closed += OnPositionsClosed;
ExecuteOrder("EURUSD", InitialVolume, GetRandomTradeType());
ExecuteOrder("GBPUSD", InitialVolume, GetRandomTradeType());
}
private void ExecuteOrder(string symbol, long volume, TradeType tradeType)
{
var result = ExecuteMarketOrder(tradeType, symbol, volume, "Martingale", StopLoss, TakeProfit);
if (result.Error == ErrorCode.NoMoney)
Stop();
}
private void OnPositionsClosed(PositionClosedEventArgs args)
{
Print("Closed");
var position = args.Position;
if (position.Label != "Martingale")
return;
if (position.GrossProfit > 0)
{
ExecuteOrder(position.SymbolName, InitialVolume, GetRandomTradeType());
}
else
{
if (position.TradeType == TradeType.Buy)
ExecuteOrder(position.SymbolName, (int)position.Volume * 2, TradeType.Sell);
else
ExecuteOrder(position.SymbolName, (int)position.Volume * 2, TradeType.Buy);
}
}
private TradeType GetRandomTradeType()
{
return random.Next(2) == 0 ? TradeType.Buy : TradeType.Sell;
}
}
}
You can modify this accordingly
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
16 Dec 2019, 14:28
Hi useretinv,
I am not sure what do you mean when you say.
to apply new Multi-Symbol Back testing code
This cBot is not a multisymbol cBot. It just trades one symbol. Do you want this cBot to trade on many symbols at the same time?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
20 Dec 2019, 16:44
Hi Mario,
No that is not possible at the moment.
Best Regards,
Panagiotis
Join us on Telegram
@PanagiotisCharalampous