Topics
Replies
PanagiotisCharalampous
30 Apr 2024, 05:27
Hi there,
Can you please record a video demonstrating what you are looking at?
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
30 Apr 2024, 05:26
RE: How to generate the .pwd file for the CLI commands ?
driftingprogrammer said:
Does the CLI work? Is anyone using it?
I started my cBot as an external process and it works fine.
But when I copy the exact same command and try to invoke it from the command prompt by first going to the folder where we have the ctrader-cli.exe I get an error saying the password file needs to be specified.
When I specify the password file which is a text file with my password it continues to say password file could not be found. I tried all formats of specifying the path but no luck, I always sayd password file not found.
Can someone give me an example of a command with the password file specified that works.
For me even a simple command like
ctrader-cli.exe symbols --ctid=email@yahoo.com --pwd-file=C:/Users/Administrator/Documents/password.pwd
does not work. I am using ICMarkets broker.
Thanks in advance.
Hi there,
Can you share screenshots showing where the password file is and the exact message you receive?
@PanagiotisCharalampous
PanagiotisCharalampous
30 Apr 2024, 05:24
RE: RE: RE: RE: RE: RE: RE: RE: Issue / explanation AmountRisked
sebastien.t said:
Do you have any idea where the issue is?
It is very weird…
Thank you
It's a bug, it will be fixed in upcoming updates
@PanagiotisCharalampous
PanagiotisCharalampous
29 Apr 2024, 07:46
RE: RE: RE: RE: Issue / explanation AmountRisked
sebastien.t said:
Good day,
I have both Mac and Windows
Here is the results this morning from my Mac
And from my Windows server
The only difference I can see with your screenshot is the PipSize…
Can you please advise your broker and cTrader version?
@PanagiotisCharalampous
PanagiotisCharalampous
29 Apr 2024, 06:00
RE: Rectangular Box Adjust
jdharmasena said:
In Ctrader mobile you can set the price of a upper and lower level of a rectangle. But I could not find it in the desktop version.
There is no such option on the desktop at the moment.
@PanagiotisCharalampous
PanagiotisCharalampous
29 Apr 2024, 05:58
RE: RE: Issue / explanation AmountRisked
sebastien.t said:
True in your case it is perfectly fine.
But look at my results for the same code on a Demo account
I have no idea why I get the weird results…
PanagiotisCharalampous said:
Hi there,
I don't see any problem.
Can you please explain what the problem is?
Best regards,
Panagiotis
Can you confirm you are using cTrader for Mac?
@PanagiotisCharalampous
PanagiotisCharalampous
28 Apr 2024, 15:44
Hi there,
I don't see any problem.
Can you please explain what the problem is?
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
28 Apr 2024, 15:40
RE: RE: RE: Backtest (visual vs non-visual mode): different results
gyoy said:
alexandre.abconcept said:
ncel01 said:
Dear cTrader Team,
There is no “my case”.
As you might have noticed, the code sample provided above was only intended to report an issue.
My question was obviously generic.
Thanks for clarifying the community on this by providing an effective answer. It would be also of value to see documentation on this available.
Hello is there news on this ? I have the same issue.. When I backtest in Visual mode it is not the same results than in not visual..
Hi, any news? I have the same issue. I don't know how reliable my code is. The visual mode shows a fairly large negative value, while the silent mode shows positive value of the same magnitude.
Hi there,
See my response above.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
28 Apr 2024, 15:35
Hi there,
What ideas do you need :) ?
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
28 Apr 2024, 15:35
Hi there,
Only human faces can be uploaded as profile pictures.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
28 Apr 2024, 15:34
Hi there,
Only human faces can be uploaded as profile pictures.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
28 Apr 2024, 15:33
RE: RE: RE: RE: RE: RE: data isn't read correctly?
nafewhossain03 said:
PanagiotisCharalampous said:
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
mine is like this
could it be that you have different data? i'm using fusion market as broker, 22.5 per million as commission or 2.25 per lot, 4.5 roundturn
Hi there,
The problem in your logic is here
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;
}
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
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
30 Apr 2024, 05:28
Hi there,
What do you mean when you say symbol specifications?
Best regards,
Panagiotis
@PanagiotisCharalampous