Topics
Replies
PanagiotisCharalampous
03 Jul 2020, 09:00
Hi Phil,
You can add your stop loss in the following method
ExecuteMarketOrder(tradeType, strSymbol, volumeInUnits, cBotLabel, 0, TP_in_pips);
there were 0 is at the moment. You just need to replace it with the stop loss you want.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
03 Jul 2020, 08:54
( Updated at: 21 Dec 2023, 09:22 )
Hi ctid956028,
Unfortunately I could not reproduce this behavior. This is what I get no matter how many instances I add or how many times I refresh my chart.
If you can record a short video demonstrating the steps you take and the issue it might help us reproducing the problem.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
03 Jul 2020, 08:25
Hi irmscher9,
You would not be able to do that even if the trades appeared on the chart.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
02 Jul 2020, 16:58
Hi ctid956028,
Did you read my post above?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
02 Jul 2020, 16:13
Hi ctid956028,
To check this we will need the complete indicator code and the indicator parameters. Can you please provide them to us?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
02 Jul 2020, 15:19
Hi Tj,
You can read what a product backlog is here :)
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
02 Jul 2020, 14:21
Hi Tj,
Adding more hotkeys is in our backlog.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
02 Jul 2020, 12:36
Hi ctid956028,
The mistake in your code is here
for (int i = LastIndexSearched + 1; i < SymbolTicks.Count; i++)
{
You seem to assume that there is a correlation between the bar index and the ticks index but there isn't. The correct should be the following
for (int i = 0; i < SymbolTicks.Count; i++)
{
You also need to make sure that you have tick data that goes back to the first loaded bar and beyond. So in the OnStart() method, you need to add the following code
while (SymbolTicks[0].Time > Bars.OpenTimes.First())
{
SymbolTicks.LoadMoreHistory();
}
Here is the complete working code
using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using System.Linq;
namespace cAlgo
{
[Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class TestIndicator : Indicator
{
private readonly string Version = "1.0";
///////////////////////////////////////
// Test
///////////////////////////////////////
// Changed 1.0 :
// 02-07-2020 initial setup
///////////////////////////////////////
//
#region class Globals
Ticks SymbolTicks;
// Symbol SymbolPrices;
int IndexSkip = 0;
int LastIndexSearched;
#endregion class Globals
#region Events
protected override void Initialize()
{
LastIndexSearched = -1;
SymbolTicks = MarketData.GetTicks(SymbolName);
while (SymbolTicks[0].Time > Bars.OpenTimes.First())
{
SymbolTicks.LoadMoreHistory();
}
Print(this.ToString() + ":" + Version);
}
public override void Calculate(int index)
{
if (index != IndexSkip)
return;
IndexSkip = index + 10;
DateTime UsedTime = Bars.OpenTimes.LastValue;
double TimedBid = FillBid(UsedTime);
Chart.DrawText(index.ToString(), this.ToString() + index + "' " + index + "\n" + TimedBid + "\n" + UsedTime, UsedTime, TimedBid, Color.Yellow);
}
#endregion Events
#region Private Methods
double FillBid(DateTime dt)
{
for (int i = 0; i < SymbolTicks.Count; i++)
{
if (SymbolTicks[i].Time >= dt)
{
LastIndexSearched = i;
return SymbolTicks[i].Bid;
}
}
return double.NaN;
}
#endregion Private Methods
}
}
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
02 Jul 2020, 12:21
Hi ctrader001,
Thanks, we managed to reproduce this issue and we will fix it in a future update.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
02 Jul 2020, 11:54
Hi agent.xzxz,
No this is not possible unfortunately.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
02 Jul 2020, 10:18
Hi noppanon,
We do not have such plans at the moment since we did not have demand for such a feature.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
02 Jul 2020, 08:50
Hi Delphima,
Try the below
rsi_O = Indicators.RelativeStrengthIndex(Bars.OpenPrices, Periods);
rsi_C = Indicators.RelativeStrengthIndex(Bars.ClosePrices, Periods);
rsi_H = Indicators.RelativeStrengthIndex(Bars.HighPrices, Periods);
rsi_L = Indicators.RelativeStrengthIndex(Bars.LowPrices, Periods);
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
02 Jul 2020, 08:42
Hi m25687423,
It seems you missed the news.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
02 Jul 2020, 08:40
Hi noppanon,
You can't, they need to be two separate indicators.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
02 Jul 2020, 08:36
Hi irmscher9,
No but this is just a UI feature. You can all the information you need in the History section.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
01 Jul 2020, 16:39
Hi Ilia,
Yes you can. Check visual backtesting.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
01 Jul 2020, 16:02
Hi rgasch,
There is no API call for this. You will need to convert the relevant amount to base asset units. You need to calculate the rate between your account currency and your symbol's base asset. Here a trader tried to do it for calculating the required margin but it is a good starting point.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
01 Jul 2020, 15:39
Hi ctrader001,
Can you please post some screenshots or a video that will allow us to visualize the problem and reproduce it?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
01 Jul 2020, 15:32
Hi qcwojt,
There is no such option at the moment.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
03 Jul 2020, 12:18
Hi Vadivelan,
You can read how to create cBots/Indicators here. However these strategies seem to use custom libraries which you will need to add as references. I do not know where to find them so it would be better to contact the cBot creators for more detailed support.
Best Regards,
Panagiotis
Join us on Telegram
@PanagiotisCharalampous