Backtesting with Pending Orders - Amazing in Backtest, Devastating in Reality - is it my code?
13 Dec 2023, 21:22
Hi there,
I've developed a few strategies recently that rely on Pending Orders and they blow me away in Backtest but the Reality is very different. Any idea why this and is there a way to fix it? Is there something wrong with my code or is this just a “thing” in cTrader? Many thanks in Advance.
using System; using System.Collections.Generic; using System.Linq; using System.Text; using cAlgo.API; using cAlgo.API.Collections; using cAlgo.API.Indicators; using cAlgo.API.Internals;
namespace cAlgo.Robots { [Robot(AccessRights = AccessRights.None)] public class OutsideBollingerBounces5mAllDay1m : Robot { private BollingerBands BB;
[Parameter(DefaultValue = 6, Group = "Extra")] public int StartTime { get; set; }
[Parameter(DefaultValue = "BollingerBounceBuy", Group = "General")] public string LabelBuy { get; set; }
[Parameter(DefaultValue = "BollingerBounceSell", Group = "General")] public string LabelSell { get; set; }
You should explain your issue with more details. You should provide at least some examples of what the problem is.
Best regards,
Panagiotis
Thank you for such a Quick Response. Ok, so first we have the backtest results, testing this on the Nas100 (Pepperstone) 12 June 2023 - 12 Dec 2023, it shows an increase of 1,782% - (Yeay! Early Retirement) - but then I notice that a LOT of the trades are doubled up, which shouldn't be possible given the code setup (in my limited experience) and many of the trades close past their StopLoss and TakeProfit by substantial amounts. Here's a summary:
Results are Unrealistic
Trades double up - (Trades 5 and 6, for example.)
Trades close beyond the TakeProfit by a substantial amount: (Trades 7, 9, 23, etc.)
Trades close beyond the StopLoss by a substantial amount: (Trades 107, 183, etc.)
I'm currently trialling this cBot in a Demo account for a real-life comparison.
(Edit: FYI, Huge Fan of the Software and Support (so much easier than learning MQL5) - this has been a game-changer for me, personally, and I recommend cTrader/Pepperstone to everyone interested)
It is still hard to help you without exact steps on how to reproduce the issues on our machines. If you want the community to help you with coding issues, you need to help them reproduce the problem in two minutes :) Nobody will spend hours guessing what is wrong. We have our own problems to solve :)
It is still hard to help you without exact steps on how to reproduce the issues on our machines. If you want the community to help you with coding issues, you need to help them reproduce the problem in two minutes :) Nobody will spend hours guessing what is wrong. We have our own problems to solve :)
Best regards,
Panagiotis
Ok, I'll try to be more exact:
I don't ‘think’ there's anything wrong with my code (although, happy to be corrected)- it seems to operate (in real-time), as expected.
My Question maybe should be: Does anyone else find that the Backtest doesn't seem to reflect anywhere near the Real-Time performance when testing a cBot that uses Pending Orders (i.e. Backtest performs amazingly, but in real-time shows poor results) and has anyone overcome this problem?
(Perhaps, a setting I need to change or an add-on I need to download, a certain library I should be using?)
It is still hard to help you without exact steps on how to reproduce the issues on our machines. If you want the community to help you with coding issues, you need to help them reproduce the problem in two minutes :) Nobody will spend hours guessing what is wrong. We have our own problems to solve :)
Best regards,
Panagiotis
Ok, I'll try to be more exact:
I don't ‘think’ there's anything wrong with my code (although, happy to be corrected)- it seems to operate (in real-time), as expected.
My Question maybe should be: Does anyone else find that the Backtest doesn't seem to reflect anywhere near the Real-Time performance when testing a cBot that uses Pending Orders (i.e. Backtest performs amazingly, but in real-time shows poor results) and has anyone overcome this problem?
(Perhaps, a setting I need to change or an add-on I need to download, a certain library I should be using?)
So as @PanagiotisChar hinted in a previous post, how are you doing your back tests? What settings in the back testing mechanism do you use? Do you have any screen captures to show your back test results with your settings?
Like, you're not providing us with any details on how you are backtesting, what the parameter settings are, etc etc.
It is still hard to help you without exact steps on how to reproduce the issues on our machines. If you want the community to help you with coding issues, you need to help them reproduce the problem in two minutes :) Nobody will spend hours guessing what is wrong. We have our own problems to solve :)
Best regards,
Panagiotis
Ok, I'll try to be more exact:
I don't ‘think’ there's anything wrong with my code (although, happy to be corrected)- it seems to operate (in real-time), as expected.
My Question maybe should be: Does anyone else find that the Backtest doesn't seem to reflect anywhere near the Real-Time performance when testing a cBot that uses Pending Orders (i.e. Backtest performs amazingly, but in real-time shows poor results) and has anyone overcome this problem?
(Perhaps, a setting I need to change or an add-on I need to download, a certain library I should be using?)
So as @PanagiotisChar hinted in a previous post, how are you doing your back tests? What settings in the back testing mechanism do you use? Do you have any screen captures to show your back test results with your settings?
Like, you're not providing us with any details on how you are backtesting, what the parameter settings are, etc etc.
Ok, thanks for the feedback, this is my first community post and I'm not really aware of other ways to perform a backtest other than: I copied the code from above, pasted it into a New Algo on cTrader, Compiled using .NET6 - added the Nas100 (1m) as an instance, as above, the parameters are default - then I ran the backtest from 12/6/2023 - 12/12/2023, as above and it looked a lot like this:
It seems awesome, right? But in reality, the algorithm does not make money. My question is: Is there a way to ensure that Algorithms in Backtest perform even close to how they do in the live markets? Or does the cTrader backtest simply not work properly when using Pending Orders?
Here's an Example of one of the errors:
Trade 7: Closed at a Profit of 13.1 pips (History), even though the TakeProfit was set to 3 pips and when looking in Events, it looks like it actually Stopped Out:
I would imagine, using the same code as above, with the default parameters, backtesting in the NAS100 (1m) on the same dates would provide the same result on a different computer.
Happy to provide more information, if you could let me know what might be helpful?
gabriel.rabhi
28 Feb 2025, 10:33
( Updated at: 10 Mar 2025, 08:48 )
TICK !
Hi,
Your problem is this one :
In Backtesting, Tick() method is called every minute, on close bar because you do not choose “Tick data from Server”.
In Real, the Tick() method is called many times per seconds, each time the price is changing.
Your bot is working using minute call frequency Tick() !
You have fall in the trap of the “read the futur” of bar based backtesting. The real thing is : you win because the non Tick based backtesting is wrong !
ADVICE : never use limit orders, TakeProfit and StopLoss if you develop a bot without Ticks !!!
In Backtesting, Tick() method is called every minute, on close bar because you do not choose “Tick data from Server”.
In Real, the Tick() method is called many times per seconds, each time the price is changing.
Your bot is working using minute call frequency Tick() !
You have fall in the trap of the “read the futur” of bar based backtesting. The real thing is : you win because the non Tick based backtesting is wrong !
ADVICE : never use limit orders, TakeProfit and StopLoss if you develop a bot without Ticks !!!
Thank you for this explanation, it really is appreciated. I can't believe I missed that for so long.
On the downside, I now have backtested proof that this strategy I spent months on…. simply doesn't work. Even with a wide-range of variables in what I call an Optimisation ‘Spray and Pray’ :D.
I've coded and backtested every strategy I can find or think of, hundreds of them, and I've found maybe one that really stands the test of time with like 2 trades per year.
I'm starting to think that the likes of Gary Stevenson are right: Day Trading/Swing Trading doesn't work and the only way to make real money is wait for a super low price, go in with a reduced Lot size and wait for as long as it takes to make real profit: weeks/months/years.
Thank you for this explanation, it really is appreciated. I can't believe I missed that for so long.
On the downside, I now have backtested proof that this strategy I spent months on…. simply doesn't work. Even with a wide-range of variables in what I call an Optimisation ‘Spray and Pray’ :D.
I've coded and backtested every strategy I can find or think of, hundreds of them, and I've found maybe one that really stands the test of time with like 2 trades per year.
I'm starting to think that the likes of Gary Stevenson are right: Day Trading/Swing Trading doesn't work and the only way to make real money is wait for a super low price, go in with a reduced Lot size and wait for as long as it takes to make real profit: weeks/months/years.
I wouldn't give up. You can code a strategy that works reasonably well… I've been using one of my bots for 2 years now with good results (albeit I also watch and keep an eye on the trades just in case the market is doing something crazy).
You may find you have to limit your strategy to certain times of the day, or code your bot in such a way it gets your entries with some basic stoploss/take-profit management, and then you (human) have to manage as well.
There are some other tricks of the trade you can employ too to “fool” the markets a bit.
Lastly, since your strategy worked fine with the 1-minute bar data, why not readjust your code to work on every “Bar” instead of every “tick”? That's how I accidentally discovered the strategy I've been using with a good amount of success. :-)
Thank you for this explanation, it really is appreciated. I can't believe I missed that for so long.
On the downside, I now have backtested proof that this strategy I spent months on…. simply doesn't work. Even with a wide-range of variables in what I call an Optimisation ‘Spray and Pray’ :D.
I've coded and backtested every strategy I can find or think of, hundreds of them, and I've found maybe one that really stands the test of time with like 2 trades per year.
I'm starting to think that the likes of Gary Stevenson are right: Day Trading/Swing Trading doesn't work and the only way to make real money is wait for a super low price, go in with a reduced Lot size and wait for as long as it takes to make real profit: weeks/months/years.
I wouldn't give up. You can code a strategy that works reasonably well… I've been using one of my bots for 2 years now with good results (albeit I also watch and keep an eye on the trades just in case the market is doing something crazy).
You may find you have to limit your strategy to certain times of the day, or code your bot in such a way it gets your entries with some basic stoploss/take-profit management, and then you (human) have to manage as well.
There are some other tricks of the trade you can employ too to “fool” the markets a bit.
Lastly, since your strategy worked fine with the 1-minute bar data, why not readjust your code to work on every “Bar” instead of every “tick”? That's how I accidentally discovered the strategy I've been using with a good amount of success. :-)
Well, the strategy itself was just an idea that hit me one day, it basically places a Limit Order at the major EMA lines: 14, 26, 50, 200 with a small take profit - the idea was take advantage of the ‘hesitation’ and slight bounce the price seems to make on such markets as the Nasdaq 100.
I developed the Algo a lot and the only coder under OnTick() now are some safety features and to return; the code between certain times of the day and the option of a Trailing Stop Loss (TSL).
The way I understand it is that OnBar() fires that piece code at the start of every new bar on that Timeframe, be it 5m or 1h, etc. and OnTick() just runs that piece of the code much more often. That piece of code above was just an example I made to demonstrate, usually I have a mix of OnBar, OnTick or Timers: so if my strategy is based on Bars, it'll be in OnBar but for a TSL, I'd place that in OnTick because I don't want to wait 5 minutes for that to update itself. Is there more to it than that? Honestly, I don't really use Tick Graphs.
It's obvious now I think about it that because these are micro-trades, really, the 1m bars weren't capturing the entry or TP at the right place, so I don't think switching from bars to ticks would help the ‘strategy’ as such. I did create my own OnMinute() which is basically a timer to reposition the limit orders to the EMA value (plus spread for the Longs).
The only trick I'm aware of that might ‘fool’ the market would be to use code to create a LOT of Limit orders that might manipulate market price but I believe someone went to prison for that in recent years :/
I'd love to try a new set of cbots that use VSA but I'm trading CFDs through Pepperstone and, I believe, the Volume shown is only for that CFD/ETF rather than the real, much higher, volume from the main stock exchange(s).
The only trick I'm aware of that might ‘fool’ the market would be to use code to create a LOT of Limit orders that might manipulate market price but I believe someone went to prison for that in recent years :/
You don't need lots of orders. For TP's, all you need is one that keeps “readjusting itself” every time the bid or ask price gets close to it.
And for SL's – you can have other “SL's” that aren't the actual drag/drop SL line in cTrader to avoid the “stop” hunters from seeing your actual SL placement. I would still keep the actual cTrader SL on the chart though as a last resort.
There are other tips – but that's all I'm saying for now because self-discovery can be a wonderful thing. :-)
The only trick I'm aware of that might ‘fool’ the market would be to use code to create a LOT of Limit orders that might manipulate market price but I believe someone went to prison for that in recent years :/
You don't need lots of orders. For TP's, all you need is one that keeps “readjusting itself” every time the bid or ask price gets close to it.
And for SL's – you can have other “SL's” that aren't the actual drag/drop SL line in cTrader to avoid the “stop” hunters from seeing your actual SL placement. I would still keep the actual cTrader SL on the chart though as a last resort.
There are other tips – but that's all I'm saying for now because self-discovery can be a wonderful thing. :-)
I'll take a look into that, thanks. I didn't think Stop orders (such as TP and SL) were visible to others though.
To be honest, I'm almost passed self-discovery, I've been trading for years now, and if anything: Things are just getting worse.
At least with T212 I had the option to hedge the trade with less than 100% margin, which I think suited me better.
Discord: sir_mike_x if you anyone wants to chat though
In Backtesting, Tick() method is called every minute, on close bar because you do not choose “Tick data from Server”.
In Real, the Tick() method is called many times per seconds, each time the price is changing.
Your bot is working using minute call frequency Tick() !
You have fall in the trap of the “read the futur” of bar based backtesting. The real thing is : you win because the non Tick based backtesting is wrong !
ADVICE : never use limit orders, TakeProfit and StopLoss if you develop a bot without Ticks !!!
Thank you for this explanation, it really is appreciated. I can't believe I missed that for so long.
On the downside, I now have backtested proof that this strategy I spent months on…. simply doesn't work. Even with a wide-range of variables in what I call an Optimisation ‘Spray and Pray’ :D.
I've coded and backtested every strategy I can find or think of, hundreds of them, and I've found maybe one that really stands the test of time with like 2 trades per year.
I'm starting to think that the likes of Gary Stevenson are right: Day Trading/Swing Trading doesn't work and the only way to make real money is wait for a super low price, go in with a reduced Lot size and wait for as long as it takes to make real profit: weeks/months/years.
Thanks, both of you, for the help and support. Making Huge changes in my code, backtesting, and strategy.
This code probably seems a bit basic but thought I'd share:
This is my Hidden StopLoss code, uses a timer, so if the price moves below that SL price for a pre-determined amount of time (I use 60 seconds), it closes the trade.
using System; using cAlgo.API; using cAlgo.API.Collections; using cAlgo.API.Indicators; using cAlgo.API.Internals;
namespace cAlgo.Robots { [Robot(AccessRights = AccessRights.None, AddIndicators = true)] public class HiddenSL : Robot { [Parameter(DefaultValue = 42)] public double SLPrice { get; set; }
[Parameter(DefaultValue = 60)] public int Duration { get; set; }
[Parameter(DefaultValue = true)] public bool Long { get; set; }
if(counter > Duration) { foreach(var position in Positions) { ClosePosition(position); } } } } }
2. And this one moves my Take Profit whenever the price gets too close until it gets to the price I actually want to Take Profit at. (Still in testing)
using cAlgo.API; using cAlgo.API.Indicators; using cAlgo.API.Internals;
namespace cAlgo { [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] public class TrailingTPBot : Robot { [Parameter("Trailing Distance (pts)", DefaultValue = 10)] public int TrailingDistance { get; set; }
[Parameter("Final Take Profit (pts)", DefaultValue = 100)] public int FinalTakeProfit { get; set; }
Thanks, both of you, for the help and support. Making Huge changes in my code, backtesting, and strategy.
This code probably seems a bit basic but thought I'd share:
This is my Hidden StopLoss code, uses a timer, so if the price moves below that SL price for a pre-determined amount of time (I use 60 seconds), it closes the trade.
using System; using cAlgo.API; using cAlgo.API.Collections; using cAlgo.API.Indicators; using cAlgo.API.Internals;
namespace cAlgo.Robots { [Robot(AccessRights = AccessRights.None, AddIndicators = true)] public class HiddenSL : Robot { [Parameter(DefaultValue = 42)] public double SLPrice { get; set; }
[Parameter(DefaultValue = 60)] public int Duration { get; set; }
[Parameter(DefaultValue = true)] public bool Long { get; set; }
if(counter > Duration) { foreach(var position in Positions) { ClosePosition(position); } } } } }
2. And this one moves my Take Profit whenever the price gets too close until it gets to the price I actually want to Take Profit at. (Still in testing)
using cAlgo.API; using cAlgo.API.Indicators; using cAlgo.API.Internals;
namespace cAlgo { [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] public class TrailingTPBot : Robot { [Parameter("Trailing Distance (pts)", DefaultValue = 10)] public int TrailingDistance { get; set; }
[Parameter("Final Take Profit (pts)", DefaultValue = 100)] public int FinalTakeProfit { get; set; }
Issues with your code samples above. The one where you wait allegedly 60 seconds. It doesn't wait 60 seconds. The amount of time it waits can vary depending on how often the ticks come through. You're also not guaranteed a tick per second. To actually wait 60 seconds, you need to create a timer event.
You're also not resetting your timer in the code you provided. That is, it will continuously count upwards, and never down if the price isn't passed your SL.
Lastly, you're bot will close every symbol, even if the price hasn't moved beyond your SL, if the counter rises above 60.
//Quick code to kinda fix your issues as you have it.
//Here is some example code on how to handle it for ONE symbol.
System.Timers.Timer aTimer = new System.Timers.Timer();
aTimer.Elapsed += new ElapsedEventHandler(OnTimerEvent);
aTimer.Interval = 1000; // ~ 1 second
aTimer.Enabled = true;
// Specify what you want to happen when the Elapsed event is raised.
private static void OnTimerEvent(object source, ElapsedEventArgs e)
{
if (Long)
{
if (Symbol.Ask < SLPrice)
counter+=1;
else
counter -= 1;
}
else //shorts
{
if(Symbol.Ask > SLPrice)
counter+=1;
else
counter -= 1;
}
//can't have the counter go negative
if (counter < 0)
counter = 0;
if(counter > Duration)
{
ClosePosition(position);
}
}
}
//If you want it to work properly for every symbol or every position while only running ONE bot instance,
//then you'll need to put everything in arrays or dictionaries (or something) and run through every symbol in your array.
//you'll also have to provide as a parameter (or coded) the symbols you intend to have the bot watch and store those in an array.
Symbol[] _symbolsData;
int[] counter;
System.Timers.Timer[] aTimer;
Bars[] _marketSeries;
protected override void OnStart()
{
_symbolsData = new Symbol[numberOfSymbolsToWatch];
_marketSeries = new Bars[numberOfSymbolsToWatch];
for (int x=0; x < numberOfSymbolsToWatch; x++)
{
_symbolsData[x] = Symbols.GetSymbol(Bars[x].SymbolName);
//Set each SYmbol to listen to its own OnTick Method
_symbolsData[x].Tick += OnTickEventMethod;
_marketSeries[x] = MarketData.GetBars(Bars.Timeframe, _symbolsData[x]);
//set the timer and interval for each symbol we are watching
aTimer[x] = new System.Timers.Timer();
aTimer[x].Elapsed += new ElapsedEventHandler(OnTimerEvent);
aTimer[x].Interval = 1000; // ~ 1 second
aTimer[x].Enabled = true;
counter[x] = 0;
}
}
private void OnTickEventMethod(SymbolTickEventArgs stea)
{
int x = Array.FindIndex(_symbolsSymbols, element => element == stea.SymbolName);
if (x == _currentSymbolsIndex)
return;
//blah blah blah. DO your ontick stuff here
}
// Specify what you want to happen when the Elapsed event is raised.
private static void OnTimerEvent(object source, ElapsedEventArgs e)
{
//get the timer for the specific symbol
//check the counter[x] for the symbol
//close position[x] if needed
}
As for your TP code, similar issue in that it's only watching the “ticks” for the symbol that the instance is set against. So hypothetically, if the bot instance is running against EURUSD, and news comes out for either GBP or JPY, those pairs could have several more ticks within the space of one tick on EURUSD - your bot misses out on those additional ticks. Again, you're not guaranteed tick-for-tick between symbols, and that could definitely throw off your bot's ability to keep up, and the overall trade results.
PS: you misspelled my name in an interesting way. :-)
Thanks, both of you, for the help and support. Making Huge changes in my code, backtesting, and strategy.
This code probably seems a bit basic but thought I'd share:
This is my Hidden StopLoss code, uses a timer, so if the price moves below that SL price for a pre-determined amount of time (I use 60 seconds), it closes the trade.
using System; using cAlgo.API; using cAlgo.API.Collections; using cAlgo.API.Indicators; using cAlgo.API.Internals;
namespace cAlgo.Robots { [Robot(AccessRights = AccessRights.None, AddIndicators = true)] public class HiddenSL : Robot { [Parameter(DefaultValue = 42)] public double SLPrice { get; set; }
[Parameter(DefaultValue = 60)] public int Duration { get; set; }
[Parameter(DefaultValue = true)] public bool Long { get; set; }
if(counter > Duration) { foreach(var position in Positions) { ClosePosition(position); } } } } }
2. And this one moves my Take Profit whenever the price gets too close until it gets to the price I actually want to Take Profit at. (Still in testing)
using cAlgo.API; using cAlgo.API.Indicators; using cAlgo.API.Internals;
namespace cAlgo { [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] public class TrailingTPBot : Robot { [Parameter("Trailing Distance (pts)", DefaultValue = 10)] public int TrailingDistance { get; set; }
[Parameter("Final Take Profit (pts)", DefaultValue = 100)] public int FinalTakeProfit { get; set; }
Issues with your code samples above. The one where you wait allegedly 60 seconds. It doesn't wait 60 seconds. The amount of time it waits can vary depending on how often the ticks come through. You're also not guaranteed a tick per second. To actually wait 60 seconds, you need to create a timer event.
You're also not resetting your timer in the code you provided. That is, it will continuously count upwards, and never down if the price isn't passed your SL.
Lastly, you're bot will close every symbol, even if the price hasn't moved beyond your SL, if the counter rises above 60.
//Quick code to kinda fix your issues as you have it.//Here is some example code on how to handle it for ONE symbol. System.Timers.Timer aTimer = new System.Timers.Timer(); aTimer.Elapsed += new ElapsedEventHandler(OnTimerEvent); aTimer.Interval = 1000; // ~ 1 second aTimer.Enabled = true; // Specify what you want to happen when the Elapsed event is raised. private static void OnTimerEvent(object source, ElapsedEventArgs e) { if (Long) { if (Symbol.Ask < SLPrice) counter+=1; else counter -= 1; } else //shorts { if(Symbol.Ask > SLPrice) counter+=1; else counter -= 1; } //can't have the counter go negative if (counter < 0) counter = 0; if(counter > Duration) { ClosePosition(position); } } }//If you want it to work properly for every symbol or every position while only running ONE bot instance, //then you'll need to put everything in arrays or dictionaries (or something) and run through every symbol in your array.//you'll also have to provide as a parameter (or coded) the symbols you intend to have the bot watch and store those in an array. Symbol[] _symbolsData; int[] counter; System.Timers.Timer[] aTimer; Bars[] _marketSeries;protected override void OnStart(){ _symbolsData = new Symbol[numberOfSymbolsToWatch]; _marketSeries = new Bars[numberOfSymbolsToWatch]; for (int x=0; x < numberOfSymbolsToWatch; x++) { _symbolsData[x] = Symbols.GetSymbol(Bars[x].SymbolName); //Set each SYmbol to listen to its own OnTick Method _symbolsData[x].Tick += OnTickEventMethod; _marketSeries[x] = MarketData.GetBars(Bars.Timeframe, _symbolsData[x]); //set the timer and interval for each symbol we are watching aTimer[x] = new System.Timers.Timer(); aTimer[x].Elapsed += new ElapsedEventHandler(OnTimerEvent); aTimer[x].Interval = 1000; // ~ 1 second aTimer[x].Enabled = true; counter[x] = 0; }}private void OnTickEventMethod(SymbolTickEventArgs stea){ int x = Array.FindIndex(_symbolsSymbols, element => element == stea.SymbolName); if (x == _currentSymbolsIndex) return; //blah blah blah. DO your ontick stuff here} // Specify what you want to happen when the Elapsed event is raised. private static void OnTimerEvent(object source, ElapsedEventArgs e) { //get the timer for the specific symbol //check the counter[x] for the symbol //close position[x] if needed }
As for your TP code, similar issue in that it's only watching the “ticks” for the symbol that the instance is set against. So hypothetically, if the bot instance is running against EURUSD, and news comes out for either GBP or JPY, those pairs could have several more ticks within the space of one tick on EURUSD - your bot misses out on those additional ticks. Again, you're not guaranteed tick-for-tick between symbols, and that could definitely throw off your bot's ability to keep up, and the overall trade results.
PS: you misspelled my name in an interesting way. :-)
Apologies for the misspelling, poor spelling is actually a pet hate of mine so I'm doubly embarrassed.
You're right on all counts.
To be honest, though, I only trade one symbol at a time, usually only GER40 or JPN225 depending on the time of day.
And yeah, the idea for my Stop Loss is just to avoid that wick, you know when you place an SL and it just wicks down for a second before shooting back off to where you would be in profit? That's all that is, I'll take your code though, nothing wrong with being thorough. I literally knocked these up in minutes and I'm kind of a self-taught coder. We did have a class, a course, but they were very focused on “here's the book, teach yourself” and that was only a couple of years ago.
I've made an average of 17% of my total account balance Tues, Wed, Thurs, and at the time of writing (Friday 5am) I'm already 5% of my account balance up on the day. (A JPN225 Long I left open overnight)
A mix of things: Fewer Trades, GER40 in the morning from the European Open, waiting for clear direction before ‘Trade and Hold’ style trading using the two cBots listed above. Then switching to JPN225 in the afternoon about an hour after the US Open until Close.
PanagiotisCharalampous
14 Dec 2023, 07:13
Hi there,
You should explain your issue with more details. You should provide at least some examples of what the problem is.
Best regards,
Panagiotis
@PanagiotisCharalampous