
Topics
Replies
PanagiotisCharalampous
28 Apr 2024, 14:53
Hi there,
Please share a link to the indicator you are trying to add and explain to us what the exact problem you are facing is.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
28 Apr 2024, 14:52
RE: Read nested/added positions
swapd0 said:
Maybe on Monday I can capture some screen shots when the market is open.
I mean that, if I buy one lot of XAGUSD at 27.000$ and later when the silver is at 27.100$ I double the position. In cTrader web I got one position on XAGUSD with two lots at 27.050$
But if I send a ProtoOAReconcileReq message I receive two positions, one at 27.000$ with one lot and another one at 27.100$ with one lot.
Hi swapd0,
If you are looking to modify a position, then you should add the position id in your ProtoOANewOrderReq message

Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
28 Apr 2024, 14:48
Hi there,
It could be anything e.g. slippage or an issue in your cBot's logic. First of all make sure you are backtesting using tick data. Then compare trades one by one to spot what is the difference (entry price, commissions and swaps, something else?)
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
28 Apr 2024, 14:45
Hi there,
What error message do you receive? Can you share a screenshot?
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
27 Apr 2024, 08:09
Hi there,
Use ClosePositionAsync() instead
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
27 Apr 2024, 08:07
Hi there,
I did not understand what you mean with the below
after that I read two positions in my application but in cTrader I got just one position.
Can you please provide examples?
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
27 Apr 2024, 08:06
Hi there,
Can you please be more specific with the problem? Which specific indicator are you trying to add and what exactly happens?
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
27 Apr 2024, 08:04
Hi there,
You should talk to your broker regarding execution issues.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
27 Apr 2024, 08:02
Hi there,
In order to receive assistance, you should share your indicator's source code.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
27 Apr 2024, 08:01
Hi there,
If the issue persists please send us some troubleshooting info and quote the link to this discussion.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
27 Apr 2024, 08:00
Hi there,
Is this a question? Are you facing any problems with the mobile application?
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
27 Apr 2024, 07:58
Hi there,
Is it possible to enlarge the time axis so that we can see dates two or three months ahead?
Check here
Secondly, somme pairs haven't enough data on Monthly's time frames. Can I download more data?
Historical data is provided by your broker. Talk to them
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
27 Apr 2024, 07:55
Hi there,
Can you record a video demonstrating your actions so that we can understand what you are looking at?
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
27 Apr 2024, 07:54
Hi there,
This could be caused by differences in leverage or the traded symbols missing from your broker.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
26 Apr 2024, 06:26
Hi Michael,
Active Symbol Panel is available in cTrader Desktop. You just need to show it

Risk reward tool will be added in a future release.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
26 Apr 2024, 06:23
Hi there,
Check the commissions and swaps of your position. They are added to your position's net profit.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
26 Apr 2024, 06:22
Hi there,
It will be added in a future release of the desktop application.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
26 Apr 2024, 06:16
RE: RE: RE: RE: data isn't read correctly?
nafewhossain03 said:
PanagiotisCharalampous said:
nafewhossain03 said:
PanagiotisCharalampous said:
Hi there,
Please share the complete cBot code and information on how to reproduce this (Symbol, timeframe, dates) so that we can advise.
Best regards,
Panagiotis
using cAlgo.API;using System.Threading;namespace cAlgo{ [Robot(AccessRights = AccessRights.None)] public class SinglePositionBot : Robot { private double StopLossPips = 10; private double TakeProfitPips = 20; private TradeType _lastTradeType; private double _lastVolume; private int _doubleCount; protected override void OnStart() { if (SymbolName == "EURUSD") { StopLossPips = 10; TakeProfitPips = 20; } else if (SymbolName == "GBPUSD") { StopLossPips = 13.5; TakeProfitPips = 27; } else if (SymbolName == "USDJPY") { StopLossPips = 11; TakeProfitPips = 22; } else if (SymbolName == "USDCHF") { StopLossPips = 15; TakeProfitPips = 30; } _lastTradeType = TradeType.Buy; _lastVolume = 1000; Positions.Opened += OnPositionOpened; ExecuteMarketOrder(_lastTradeType, SymbolName, _lastVolume, "SinglePositionBot", StopLossPips, TakeProfitPips); } protected override void OnTick() { if (Positions.Find("SinglePositionBot", SymbolName) == null && Symbol.Spread == 0) { if (LastResult.Position.GrossProfit > 0) { _lastVolume = 1000; _lastTradeType = LastResult.Position.TradeType; _doubleCount = 0; } else if ( LastResult.Position.GrossProfit < 0) { VolAmount(); _lastTradeType = LastResult.Position.TradeType == TradeType.Buy ? TradeType.Sell : TradeType.Buy; } ExecuteMarketOrder(_lastTradeType, SymbolName, _lastVolume, "SinglePositionBot", StopLossPips, TakeProfitPips); } } private void OnPositionOpened(PositionOpenedEventArgs args) { if (args.Position.StopLoss == null && LastResult.Position.SymbolName == SymbolName) { ClosePosition(LastResult.Position); } } private double VolAmount() { _lastVolume = LastResult.Position.VolumeInUnits * 2; _doubleCount++; if (_doubleCount >= 12) { _lastVolume = 1000; _doubleCount = 0; } return _lastVolume; } }}
Hi there,
We still need information on how to reproduce this (Symbol, timeframe, dates) so that we can advise.
Best regards,
Panagiotis
the symbols are eurusd, gbpusd starting from 7/11/2022 utc+2 5min timeframe.
on eurousd the 161st tradeon gbpusd the 3247th and 3311th trade
Trade 161 looks correct to me
@PanagiotisCharalampous
PanagiotisCharalampous
26 Apr 2024, 06:10
RE: RE: [ A tough one ] Check if there’s an active trade
mashazona said:
PanagiotisCharalampous said:
Hi there,
If you are checking if the orders have been filled, you should use the PendingOrders.Filled event instead. You should cancel the remaining orders only when the order is filled.
Best regards,
Panagiotis
I’ve figured it out alread, now I have a different problem, do you have an idea how to write a code to check if a trade hits TP ?
See an example of how to achieve this in the link below
https://help.ctrader.com/ctrader-automate/references/Trading/Positions/PositionCloseReason/#namespace
@PanagiotisCharalampous
PanagiotisCharalampous
28 Apr 2024, 15:33
RE: RE: RE: RE: RE: RE: data isn't read correctly?
nafewhossain03 said:
Hi there,
The problem in your logic is here
You are determining the size of the next trade based on an open position's profit, which changes on each tick. You should check historical trades using the History collection instead.
Best regards,
Panagiotis
@PanagiotisCharalampous