Each broker has a different price feed therefore it is expected that the results will be different. You should backtest/optimize using the price feed of the broker you are planning to trade with.
Best regards,
Panagiotis
Oui c'est exactement ce que j'ai fais. Et avec les flux du courtier, les résultats étaient trop à la baisse par rapport aux flux de ctrader. En plus de ça le backtes et l'optimisatio avec les flux de fpmarkets sont beaucou plus rapide que ceux de ctrader. Chez fpmarket le backtest et l'optimisatio finissent très très vite et les résultat sont énormément à la baisse par rappor aux résultat avec les flux de ctrader.
Vous me conseillez quoi sil vous plaît ?
S'il vous plaît, répondez moi
Hi there,
Please make sure that the backtesting settings are the same (e.g. you use tick data in both cases). If all settings are the same, feel free to provide more information e.g. screenshots/videos of what you are looking at.
You did not describe how you initiated the partial closing. Did you do it manually? Through a cBot? Can you provide the exact steps you followed to reproduce the behavior?
Thank you. If i send the cbot to someone who doesn't have this custom indicator, he can use the cbot without this custom indicator ? If not is there a way to include the custom indicator as a ressource in my cbot or it will be automatically included in the .algo fille I will send to the user ?
Yes the compiled cBot already contains the custom indicator. You only need to send the custom indicator if the receiver plans to modify the cBot's code. He will require the custom indicator to compile the cBot.
Can you please share your plugins code and provide exact steps on how we can reproduce this behavior?
Best regards,
Panagiotis
I used the sample codes from cTrader they are build in samples..
- Previous Bar Info - TradeWatch Tab Sample
Best regards
Do I need to post while they are available in cTrader?
Hi there,
I tried to reproduce this but with no luck. Any change you can record a video that would allow us to see the steps you are taking to reproduce this behavior?
Hi Panagiotis, the issue persists, do you know if it has been resolved? Perhaps I need to update the platform manually instead of waiting for the automatic update? Thanks!
OnTick() is a method of a robot, not of a plugin. Same for Bars property. Here is a starting point for handling tick events and accessing bars in a plug in
using System;using cAlgo.API;using cAlgo.API.Collections;using cAlgo.API.Indicators;using cAlgo.API.Internals;namespace cAlgo.Plugins{ [Plugin(AccessRights = AccessRights.None)] public class Test : Plugin { Bars _bars; Symbol _symbol; protected override void OnStart() { // To learn more about cTrader Automate visit our Help Center: // https://help.ctrader.com/ctrader-automate _bars = MarketData.GetBars(TimeFrame.Minute); _symbol = Symbols.GetSymbol("EURUSD"); _symbol.Tick += _symbol_Tick; } private void _symbol_Tick(SymbolTickEventArgs obj) { Print(_bars.ClosePrices.Last(1)); } protected override void OnStop() { // Handle Plugin stop here } } }
Best regards,
Panagiotis
There is an error on this line : Print(_bars.ClosePrices.Last(1));
_bars doesn't know the methods or ClosePrices.Last and therefore fails to call them.
In order to get a closed position's p&l, you need to get the deals using ProtoOADealListReq. The ProtoOADeal.ProtoOAClosePositionDetail will provide you with the information of the closed position and from there you can calculate the P&L of each position.
Each broker has a different price feed therefore it is expected that the results will be different. You should backtest/optimize using the price feed of the broker you are planning to trade with.
PanagiotisCharalampous
10 Dec 2024, 07:50
Hi there,
Can you please let us know your broker and your operating system?
Best regards,
Panagiotis
@PanagiotisCharalampous