Topics
Replies
PanagiotisCharalampous
22 Apr 2024, 08:55
Hi there,
You should talk to your broker about this.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
22 Apr 2024, 08:54
Hi there,
Bu definition no, since it is impossible to simulate latency, slippage and other conditions that affect live trading.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
22 Apr 2024, 08:53
RE: RE: Backtesting on Multi Timeframe
sebastien.t said:
Good day,
thank you for your answer.
Do you have a workaround?
The idea of my code/bot is to check some data in the past for the H4 to know if I am bullish or bearish and the to deep dive in the 1 minute chart.
Basically I have to go 60 bars on the timeframe and then go to the m1. Let s say I want to backtest from the 1st february, I check the H4 10 days before (60*4/24), that should be around mid of January and then I check some data on that date on the m1.
So most of the time I need to LoadMoreHistory on the m1.
Thank you
Seb
PanagiotisCharalampous said:
Hi there,
Your problem is here
while (_OfTimeFrameBars.OpenTimes[0] > time_to_test){ var numberOfLoadedBars = _OfTimeFrameBars.LoadMoreHistory();
LoadMoreHistory does not work in backtesting therefore your code enters an infinite loop.
Best regards,
Panagiotis
Hi Seb,
The workaround I use is to start the backtesting at earlier dates so that all the necessary information is loaded, while skipping all trading operations until a custom defined date. So I have a set of parameters like this
which replace the backtesting start date and I move my backtesting start date as far in the past as I want.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
22 Apr 2024, 06:28
Hi there,
You can access open positions through the Positions collection.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
22 Apr 2024, 06:25
RE: Cannot Ctrader Copy cannot copy
alnaffay2000 said:
Whenever im trying to copy wiggle strategy on c trader in pepperstone im getting the error the following is not allowed. Please contact your broker for more info
im using ctrader with pepperstone.
Peppestone does not offer cTrader Copy
@PanagiotisCharalampous
PanagiotisCharalampous
22 Apr 2024, 06:25
Hi there,
These features are not available yet in cTrader for Mac. They will be added in future updates.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
22 Apr 2024, 06:23
RE: RE: Column is missing on export
eynt said:
The issue is still unsolved
An update has not been released yet.
@PanagiotisCharalampous
PanagiotisCharalampous
22 Apr 2024, 06:22
Hi there,
You can use this button to adjust your layout.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
22 Apr 2024, 06:20
RE: RE: RE: RE: Error Exception #3B086C2C in cTrader 4.8.904.0
ajaycc3 said:
Hi Panagiotis,
When is the next release? As this works fine for windows? Just issues with mac.
PanagiotisCharalampous said:
ajaycc3 said:
Hi Panagiotis,
Any update on this?
PanagiotisCharalampous said:
Hi there,
Can you please share with us the source code of the cBot?
Best regards,
Panagiotis
Hi there,
We will fix it in an upcoming release.
Best regards,
Panagiotis
We do not have a date for it unfortunately.
@PanagiotisCharalampous
PanagiotisCharalampous
22 Apr 2024, 06:19
Hi there,
It looks like a liquidity issue. You should talk to your broker about this.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
22 Apr 2024, 06:18
Hi there,
Your problem is here
while (_OfTimeFrameBars.OpenTimes[0] > time_to_test){
var numberOfLoadedBars = _OfTimeFrameBars.LoadMoreHistory();
LoadMoreHistory does not work in backtesting therefore your code enters an infinite loop.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
22 Apr 2024, 06:07
RE: RE: RE: cTrader backtests executes take profits often to optimistic. Seems like a bug
roul.charts said:
PanagiotisCharalampous said:
roul.charts said:
I'm also wondering when a stored TP is executed.
I'm in Tick-Data Backtester / Optimizer Mode
I had my own TP logic:
tpHit = position.TradeType == TradeType.Buy ? currentPrice >= targetTpLevel : currentPrice <= targetTpLevel;
And also set the same TP at Trade Execution direct with the SL in the Trade ID.
My code is always executed faster at a TP Level then the built in TP in Backtesting. I can't imagine why. Even if I set a threshold that my code is executed later - after the TP is reached.
My code is executed earlier then the built in TP.
My aim was to let the built in TP close the trade if i only buy 1 lot instead of running through my code…Hi there,
It is hard to understand your problem from an abstract description. Feel free to share source code and exact steps to reproduce what you are looking at and we will have a look.
Best regards,
Panagiotis
Ok, i can't share the whole bot. It's 3000 lines of code already. But i can make an example bot to show the difference / timing of TP execution. Is the Trade TP executed OnTick or OnBar if i'm in the backtester mode?
If you use TP, SL or pending orders which are executed at a specific level, then you should use tick data for your backtesting. If you use bar data the results will be wrong.
@PanagiotisCharalampous
PanagiotisCharalampous
20 Apr 2024, 06:18
RE: cTrader backtests executes take profits often to optimistic. Seems like a bug
roul.charts said:
I'm also wondering when a stored TP is executed.
I'm in Tick-Data Backtester / Optimizer Mode
I had my own TP logic:
tpHit = position.TradeType == TradeType.Buy ? currentPrice >= targetTpLevel : currentPrice <= targetTpLevel;
And also set the same TP at Trade Execution direct with the SL in the Trade ID.
My code is always executed faster at a TP Level then the built in TP in Backtesting. I can't imagine why. Even if I set a threshold that my code is executed later - after the TP is reached.
My code is executed earlier then the built in TP.
My aim was to let the built in TP close the trade if i only buy 1 lot instead of running through my code…
Hi there,
It is hard to understand your problem from an abstract description. Feel free to share source code and exact steps to reproduce what you are looking at and we will have a look.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
20 Apr 2024, 06:16
Hi there,
Please contact us at community@ctrader.com to check if your email address has been blacklisted.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
20 Apr 2024, 06:15
Hi there,
Your problem is here
while (Symbol.Spread != 0) //the new part that i added is from here
{
Thread.Sleep(1000);
}
If you prevent the cBot from receiving new ticks, the spread will never change.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
20 Apr 2024, 06:13
Hi there,
Unfortunately this is not possible at the moment.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
19 Apr 2024, 13:38
Hi there,
You should use args.Reason to check if the position has been closed by a stop loss.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
19 Apr 2024, 13:36
RE: RE: Error Exception #3B086C2C in cTrader 4.8.904.0
ajaycc3 said:
Hi Panagiotis,
Any update on this?
PanagiotisCharalampous said:
Hi there,
Can you please share with us the source code of the cBot?
Best regards,
Panagiotis
Hi there,
We will fix it in an upcoming release.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
19 Apr 2024, 05:30
RE: RE: Ctrader indicators and Cbots doesn't appear in the chart
touitiaures said:
PanagiotisCharalampous said:
Hi there,
Please send us some troubleshooting info and quote the link to this discussion. Let us know when you have done it so that we can check.
Best Regards,
Panagiotis
I already did that, but I have no link to share?
You need to share the link to the current discussion. Please resend so that we can track it.
@PanagiotisCharalampous
PanagiotisCharalampous
22 Apr 2024, 10:48
Hi eynt,
No there is no such option at the moment.
Best regards,
Panagiotis
@PanagiotisCharalampous