Topics
Replies
PanagiotisCharalampous
24 Oct 2024, 05:28
RE: RE: my cbot create but cant run,is there any problem
bryantan1012 said:
PanagiotisCharalampous said:
Hi there,
Please provide the code in text format so that we can copy and paste it, and let us know what the actual problem is.
Best regards,
Panagiotis
using cAlgo.API;
using cAlgo.API.Indicators;
using System;
using System.Linq;namespace cAlgo.Robots
{
[Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class GeekTraderV2 : Robot
{
[Parameter("风险百分比 (%)", DefaultValue = 1, MinValue = 0.1, MaxValue = 10, Step = 0.1)]
public double RiskPercentage { get; set; }[Parameter("ADX 趋势阈值", DefaultValue = 25, MinValue = 1, MaxValue = 100)]
public int AdxTrendThreshold { get; set; }[Parameter("止损 (点)", DefaultValue = 10, MinValue = 1, Step = 1)]
public int StopLoss { get; set; }[Parameter("止盈 (点)", DefaultValue = 20, MinValue = 1, Step = 1)]
public int TakeProfit { get; set; }private ExponentialMovingAverage ema200;
private AverageDirectionalMovementIndex adx;protected override void OnStart()
{
ema200 = Indicators.ExponentialMovingAverage(Bars.ClosePrices, 200);
adx = Indicators.AverageDirectionalMovementIndex(14);// GeekTrader V2 已启动,开始自动交易!
Print("GeekTrader V2 已启动,开始自动交易!");
}protected override void OnBar()
{
// 1. 确定趋势方向
var trend = GetTrend();// 2. 找到支撑位和阻力位
var (support, resistance) = GetSupportResistance();// 3. 在支撑位或阻力位附近进行交易
if (trend == TradeType.Buy && Symbol.Bid <= support && adx.ADX.LastValue > AdxTrendThreshold)
{
var volume = CalculateVolume(Symbol.Bid, support);
ExecuteMarketOrder(TradeType.Buy, SymbolName, volume, "Long", StopLoss, TakeProfit);
}
else if (trend == TradeType.Sell && Symbol.Ask >= resistance && adx.ADX.LastValue > AdxTrendThreshold)
{
var volume = CalculateVolume(Symbol.Ask, resistance);
ExecuteMarketOrder(TradeType.Sell, SymbolName, volume, "Short", StopLoss, TakeProfit);
}
}private TradeType GetTrend()
{
// 使用 EMA200 判断趋势方向
if (Bars.ClosePrices.Last(1) > ema200.Result.Last(1))
return TradeType.Buy;
else if (Bars.ClosePrices.Last(1) < ema200.Result.Last(1))
return TradeType.Sell;
else
return TradeType.None; // 注意这里,使用 TradeType.None 表示无趋势
}private (double, double) GetSupportResistance()
{
// 使用最近的 swing high 和 swing low 作为阻力位和支撑位
var swingHigh = Bars.HighPrices.Last(100).Max();
var swingLow = Bars.LowPrices.Last(100).Min();return (swingLow, swingHigh);
}private double CalculateVolume(double currentPrice, double stopLossPrice)
{
// 计算止损点数
var stopLossPips = Math.Abs(currentPrice - stopLossPrice) / Symbol.PipSize;// 计算最大允许风险金额
var riskAmount = Account.Balance * RiskPercentage / 100;// 计算交易量 (手)
var volume = riskAmount / (stopLossPips * Symbol.PipValue);// 限制最大交易量为 0.01 手
volume = Math.Min(volume, 0.01);return volume;
}
}
}
There is a lot on nonsense in this code. Was it generated by ChatGPT?
@PanagiotisCharalampous
PanagiotisCharalampous
23 Oct 2024, 12:15
Hi there,
No, the active symbol panel is not available in cTrader for Mac at the moment.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
23 Oct 2024, 11:47
Hi there,
Can you explain where exactly you published your cBot and with which sales team you talked with?
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
23 Oct 2024, 09:11
Hi there,
Please provide the code in text format so that we can copy and paste it, and let us know what the actual problem is.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
23 Oct 2024, 07:16
RE: RE: Private link Copytrader
Sparkymark123 said:
PanagiotisCharalampous said:
Hi there,
They just need to open the link in their browser and they will be able to follow your strategy.
Best regards,
Panagiotis
I am trying to link shared accounts in this way.
When I open the link in the browser it just shows my trading strategy and does not give me any way to link any of my own or the shared access accounts.
Hi there,
Try searching for the strategy and then press on the Start Copying button.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
23 Oct 2024, 05:08
Hi there,
Can you share a screenshot?
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
23 Oct 2024, 05:06
RE: RE: How to view the lot size for orders in history
lewisg1400 said:
PanagiotisChar said:
Hi there,
There is no such column available. You would need to do the conversion yourself manually. You can find information about the lot size in the symbol's details in the active symbol panel.
Need help? Join us on Telegram
Hi There,
I would like to know how the position size/volume can be made visible in the history tab of cTrader copy ? Also can the position and history tabs be dragged out/undocked and made larger as you can with the same tabs on desktop cTrader ? Thank you
Hi,
I would like to know how the position size/volume can be made visible in the history tab of cTrader copy ?
Just right click on the header and select which columns you wish to see
Also can the position and history tabs be dragged out/undocked and made larger as you can with the same tabs on desktop cTrader ?
No this is not possible.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
22 Oct 2024, 12:51
Hi there,
You cannot get this information via the API. For planned disruptions in trading, you should be informed by your broker.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
22 Oct 2024, 11:20
Hi there,
Unfortunately we cannot reproduce any such issues happening. You have also not shared any pop up of an error. Can you share it please and can you please record a video demonstrating this happening?
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
22 Oct 2024, 08:48
Hi there,
This is by design and it always uses the preselected color.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
22 Oct 2024, 08:34
Hi there,
I cannot reproduce any problem. Can you share screenshots demonstrating this issue?
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
22 Oct 2024, 06:31
Hi there,
Your indicator only declares two parameters while you are passing three. The code does not make much sense.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
22 Oct 2024, 05:44
( Updated at: 22 Oct 2024, 06:19 )
Hi there,
Is there a property or method a cBot can use that returns the cTrader version and/or environment, possibly a bit like RunningMode but with other info.
You can use Application.Version
Also, how do we tell from the reference documentation which features are only v5
You can't. The documentation assumes you are using the latest version of cTrader.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
22 Oct 2024, 05:41
Hi there,
1 lot of gold equals to 100 Oz, which costs roughly $273000. The leverage is 1:100 so the max you can buy is gold worth of $100000.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
22 Oct 2024, 05:37
Hi there,
I just tried this and had no problems. Can you please record a video demonstrating what exactly you are doing?
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
22 Oct 2024, 05:25
Hi there,
This code part
double fastMA_Previous = fastMA.Result[1];
double slowMA_Previous = slowMA.Result[1];
does not return the previous value. If you are looking for the previous value, use the below
double fastMA_Previous = fastMA.Result.Last(1);
double slowMA_Previous = slowMA.Result.Last(1);
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
22 Oct 2024, 05:22
RE: RE: Pip count on Ctrader Mac
bgtrader011 said:
PanagiotisCharalampous said:
Hi there,
Can you share screenshots showing that the pip counter does not agree with the chart's scale?
Best regards,
Panagiotis
yes, here it is.
As you can see I opened at 2645.50 and I closed at 2647.26 which is clearly little bit above 17 pip trade. It shows 1.75 there which makes no sense
Hi there,
This is not what I have asked for. I asked for screenshots showing that the pip counter does not agree with the chart's scale. Can you provide one? The screenshot you provided does not show any problem, the pip size is determined by the broker and can be different between brokers.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
21 Oct 2024, 12:37
RE: RE: RE: Brokers
ncel01 said:
PanagiotisCharalampous said:
ncel01 said:
Hi there,
Some remark:
Although TopFX is still marked as offering cTrader Copy, this broker have already discontinued this service almost 4 months ago.As far as I know they still offer the service through their non EU entity, same as IC Markets and FxPro
I see.
However, in my opinion, since this is a half-truth it should be made clear.
It's not our job to do such clarifications. The specified brokers are full members of the service. It's them who need to clarify for which of their clients the service is available or not.
@PanagiotisCharalampous
PanagiotisCharalampous
21 Oct 2024, 12:34
RE: RE: RE: Charts are reversed
clairendathi said:
clairendathi said:
PanagiotisCharalampous said:
Hi there,
The app you shared is TradingView, not cTrader, and the price axis is obviously inverted.
Best regards,
Panagiotis
No sorry your app and website are still showing incorrect details. I took trading views photo twice so you can see the difference with the same currency and same time. Please see your platform info
Its not allowing me to share the picture of your website,however it has allowed ne to do so via the app
The TradingView price axis is inverted, that's why you think cTrader is wrong
@PanagiotisCharalampous
PanagiotisCharalampous
24 Oct 2024, 05:30
Hi there,
You can find Fibonacci tools here
Best regards,
Panagiotis
@PanagiotisCharalampous