Thank you for sharing that. This a new parameter that is added. I looked up the Help section to try and understand what does the ProtectionType parameter do. I understand that they are three values to choose from; ProtectionType.None, ProtectionType.Relative and ProtectionType.Absolute I couldn't understand what is their effect. Could you be kind enough to elaborate what do they do to an order or position?
Thank you
Seems like even @Panagiotis doesn't know since there's been no response… he's been awfully quiet. Wonder if he's still around or on vacation or something?
Thank you. I have submitted a report. Surely the error code must mean something? Why isn't there a list of error codes somewhere?
Who are you expecting the list to be from?
Can you guarantee it's a Spotware cTrader error and not
a Microsoft one? They control the underlying operating system and .Net architecture that could be throwing the error code back to cTrader.
Who's the hardware provider you're running your software on? Dell? HP? It could have been one of their drivers that threw the error code to Microsoft's OS that bubbled up to cTrader.
Do you have an nVidia graphics card? Intel graphics? AMD? It could have been a video card error depending on what was trying to be displayed.
My point being - hardly any hardware/software provider is going to publish a list of all the possible error codes their product will throw. Half the times, you won't even know what's throwing/causing the underlying error (because of the way some errors “bubble up” through various hardware/software components to even know which vendor's error codes you'd have to research. For instance, Dell could have thrown one error, which was received by Windows .Net and given another error, which cTrader captured and reported as a third error code.
All brokers differ because they have different price feeds.
Open an account with another broker like ThinkMarkets and you'll see that their trading platform differs from cTrader brokers by several points either side as well.
Same with Oanda.
What's important is that the candles and pricing moves the same.
PLease post this under the “Suggestions” forum as this is a tech-support forum - they won't come here looking for ways to improve their product. That's what the Suggestions forum is for.
PLease post this under the “Suggestions” forum as this is a tech-support forum - they won't come here looking for ways to improve their product. That's what the Suggestions forum is for.
I believe with the event listeners, they will only work for the current running instance. That's it.
So if you have your bot under AUDUSD for example, it will only respond when bars are opened for AUDUSD.
Your code is only getting the information for the current symbol instance the bot is running under.
Thus, you need to change your code to handle multiple symbols. Example guidance below:
// We get a symbol array for the following for symbols
MySymbols = Symbols.GetSymbols("EURUSD", "GBPUSD");
//You need to get the bars data for each symbol now
Bars[] SymbolBars = new Bars[MySymbols.Length];
//You need create a variable array to keep track of the symbol's current index
int[] Indexes = new int[MySymbols.Length];
//You need create a variable array to keep track of when a new bar is opened
int[] _previousIndexes = new int[MySymbols.Length];
//Loop to initialize all the data
for (int x = 0; x < MySymbols.Length; x++)
{
//get the bars data for each symbol
SymbolBars[x] = MarketData.GetBars(<the time frame you want>, MySymbols[x]);
//define your onTick method in your code that every symbol will use to check for ticks
MySymbols[x].Tick += OnTickEventMethod;
//Initialize all these
Indexes[x] = 0;
_previousIndexes[x] = 0;
}
//You need to define and write your OnTickEventMethod
private void OnTickEventMethod(SymbolTickEventArgs stea)
{
//Get the symbol the tick event came from
int x = Array.FindIndex(MySymbols, element => element == stea.SymbolName);
//Skip any bar symbols that may not have loaded yet.
if (SymbolBars[x] == null)
return;
else
{
Indexes[x] = SymbolBars[x].ClosePrices.Count - 1;
//check if a new bar has formed
if (Indexes[x] > _previousIndexes[x])
{
//we have a new bar
//write your onBar logic here
//update our bar trackers
_previousIndexes[x] = Indexes[x];
}
//from here down is where you would put your normal tick event code
//if you want anything for the specific symbol, you have to reference it through the arrays and create arrays for your variables.
//For example, you can't do this any more:
//countLabelFuerte++
//You need to make it an array as well and do this because you only want to increase the counter for the specific symbol,
//not across all symbols:
countLabelFuerte[x]++;
//Welcome to the big leagues :-)
//If you're a beginning programmer, what I would suggest you do is get your bot working as you want it for one
//symbol only. And then when it's working to your satisfaction, convert everything to arrays to handle multiple symbols
//under one bot instance.
}
}
Why would results differ so much with only 3 trades been opened all within 17 days of each other?
One possibility is because of the market moves within those 17 days? That's how the markets work :-)
I'm not sure how you expect anyone to help you when you haven't described the strategy, shown any code, why you're using one-minute bar data as opposed to tick-data doing your testing, what time frame the bot is running under, the trade entries/exits on the back test with and without the optimized parameters, etc etc.
For instance, the bot could make decisions on every tick, but by running on one-minute bars you only get the bar data, not every tick.
Within bars they could be huge spikes not captured in bar data but would be with tick data.
Is there a reason you haven't posted a screen capture showing the issue?
Normally when I am copying a strategist, when they open trades I can see their positions live under the positions tab after the recent updates, it returned for two days and then disappeared again. Enter the image below, the red arrow shows where it's usually located.
I can't help you because I don't use cTrader Copy. However, at least you clarified where the tab missing from, because for most people, the “Positions” tab is on the “Trade” window. Lesson learned - you need to be more specific when posting issues :-)
Next time it happens report it as a technical issue within cTrader and put a link to this thread in the details section along with other pertinent information such as:
firemyst
26 Jan 2025, 06:35 ( Updated at: 14 Feb 2025, 18:19 )
RE: RE: Parameter stopLossPips and takeProfitPips in PendingOrder
ysftrades said:
Seems like even @Panagiotis doesn't know since there's been no response… he's been awfully quiet. Wonder if he's still around or on vacation or something?
@firemyst