Topics
Replies
firemyst
11 Jan 2024, 09:03
RE: RE: RE: RE: RE: cTrader "pip scale" constantly goes flukey, and nowhere near being correct
PanagiotisCharalampous said:
firemyst said:
PanagiotisCharalampous said:
Hi firemyst,
Our team is still investigating this issue. Can you please send us the template you are using at 00:29 of the video?
Best regards,
Panagiotis
Sent as requested to the “community” address with subject ATTN PANAGIOTIS
Hopefully it'll help the team figure out what's going on.
Hi firemyst,
Thank you. Unfortunately we were not being able to reproduce this yet. But we will keep trying.
Best regards,
Panagiotis
I've done it again with another template file.
I've made a new video as well showing a bit more and talking through it so your team knows exactly what I'm doing and when.
When the video finishes uploading to YouTube, I'll email the “community” account with the new video link and template file that I used this time around.
@firemyst
firemyst
10 Jan 2024, 11:40
RE: RE: RE: cTrader "pip scale" constantly goes flukey, and nowhere near being correct
PanagiotisCharalampous said:
Hi firemyst,
Our team is still investigating this issue. Can you please send us the template you are using at 00:29 of the video?
Best regards,
Panagiotis
Sent as requested to the “community” address with subject ATTN PANAGIOTIS
Hopefully it'll help the team figure out what's going on.
@firemyst
firemyst
10 Jan 2024, 07:59
RE: cTrader "pip scale" constantly goes flukey, and nowhere near being correct
PanagiotisCharalampous said:
Hi firemyst,
Any chance you can provide us with more clear images? I cannot see the pip scale in these images.
Best regards,
Panagiotis
Any updates on this? Have they discovered the issue? It's getting to be real annoying.
Check out the GER40 today in multichart mode.
You can see the same numbers on the right side of both charts, but notice how one chart is screwed and says “100” pips while the other is correct and says “10” pips based on the values:

@firemyst
firemyst
09 Jan 2024, 08:11
RE: Does cTrader support algos built under .Net8.0 yet?
PanagiotisCharalampous said:
Hi firemyst,
We have no plans for introducing support for .Net 8.0 any time soon.
Best regards,
Panagiotis
Fair enough on that.
However, what about in regards to my other questions?
@firemyst
firemyst
07 Jan 2024, 02:52
RE: RE: Here are some tips to get you started
YesOrNot said:
Hi Hi! Thanks for the help. I just made it, but it doesn't deserve. I think the problem is plotting points, not the memory operations…
Great to see the big code improvements!
That's just the start as I said.
cTrader wasn't built well enough to handle all the custom drawn objects like other trading platforms.
What I've done as a work around is included parameters in my indicators to state how far back I want items drawn:
[Parameter("Num of Bars Back to Analyze", Group = "Misc", DefaultValue = 500, MinValue = 1)]
public int NumBarsBackToAnalyze { get; set; }
Then what I do is every time a new bar is formed, I programmatically remove all the custom drawn objects that are more than “NumBarsBackToAnalyze
”.
So in the example above, when a new bar is formed, if I have any custom drawn objects on the chart more than 500 bars ago, I delete them.
It's a rolling process, keeps cTrader somewhat responsive. However, because it's a heavy burden, I only do it once every time a new bar is formed – it's a waste of resources to do it every tick.
@firemyst
firemyst
06 Jan 2024, 11:00
I'm not sure you're referencing the symbol correct. None of the symbols I've ever seen in cTrader start with “#”.
Also, have you checked your broker's website to see what the symbol is?
Last, what's the symbol when you view the trading window in cTrader? You can search for all the symbols cTrader will let you trade.
@firemyst
firemyst
05 Jan 2024, 08:08
RE: cTrader "pip scale" constantly goes flukey, and nowhere near being correct
PanagiotisCharalampous said:
Hi firemyst,
Any chance you can provide us with more clear images? I cannot see the pip scale in these images.
Best regards,
Panagiotis
I've just managed to reproduce the issue again. I will submit the Youtube link using cTrader's “Report a technical” issue right now, while the scaling is messed up, referencing this forum discussion.
@firemyst
firemyst
05 Jan 2024, 07:24
RE: cTrader "pip scale" constantly goes flukey, and nowhere near being correct
PanagiotisCharalampous said:
Hi firemyst,
Any chance you can provide us with more clear images? I cannot see the pip scale in these images.
Best regards,
Panagiotis
How much more clear do you want? If you open the images in a “new tab” on your browser and/or download them and then zoom in with the Microsoft image viewer, the market value on the right is quite clear.
I've done just that now and here they are (first one is NAS, the last two are the FTSE100 before and after restarting cTrader) :



All times are UTC + 8
@firemyst
firemyst
30 Dec 2023, 12:00
( Updated at: 31 Dec 2023, 16:08 )
RE: RE: Multiple cbots and only one position at a time
The_Dark_Knight said:
firemyst said:
If you don't want positions of the same symbol to overlap, then you need to find all positions first of the current symbol, and then doing a Positions.Count on that.
Doing a generic “Positions.Count” will count all open positions, even if you have several not open on the current symbol your bot instance is running.
For example, you could have an AUDUSD position open, a EURUSD position open, and EURJPY position open. If you only want to limit your bot so that you don't open another EURJPY position, then you need to search all positions that are just EURJPY.
Example:
int numPositionsAlreadyOpen = Positions.FindAll(p.Label, Symbol.Name).Count();
Hope that helps you even more :-)
Thanks Firemyst, that's also very helpful. I found something like that in the forum.
For now, I will apply this logic by grouping the long and short positions separately, in order to decrease exposure at times where the pairs are correlated. According to the results of QuantAnalyzer, this would greatly soften the portfolio curve, but I don't know how much to trust those hypothetical results. I'll try it first in demo.
I added it like this in each cbot. Please correct me if that´s wrong:
protected override void OnBar()
{var longPositionsCount = Positions.Count(p => p.TradeType == TradeType.Buy);
var shortPositionsCount = Positions.Count(p => p.TradeType == TradeType.Sell);
if (longPositionsCount == 0 && ShouldEnterLong()) { logic }
if (ShouldExitLong()) {CloseLongPositions();}
if (shortPositionsCount == 0 && ShouldEnterShort()) { logic }
if (ShouldExitShort()) {CloseShortPositions();}
}
I can't tell you if it's right or wrong because I'm not 100% sure what you want to do.
What your code will do though is found the number of buy positions and sell positions open across all active bot instances and won't open a long position for any symbol if you have a long position open anywhere in any account; likewise your code won't open a short position for any symbol if you have a short position open anywhere.
@firemyst
firemyst
30 Dec 2023, 10:07
( Updated at: 31 Dec 2023, 16:08 )
You're doing nothing wrong. “Position” is defined as an abstract interface in cAlgo:
https://help.ctrader.com/ctrader-automate/references/Trading/Positions/Position/
In the process of Deserialization, it involves creating an instance, and you can't create instances of interfaces.
Here's a blog article with a long way around the issue if you really need to do that:
https://dotnetfalcon.com/deserialize-into-interface/
@firemyst
firemyst
30 Dec 2023, 09:54
If you don't want positions of the same symbol to overlap, then you need to find all positions first of the current symbol, and then doing a Positions.Count on that.
Doing a generic “Positions.Count” will count all open positions, even if you have several not open on the current symbol your bot instance is running.
For example, you could have an AUDUSD position open, a EURUSD position open, and EURJPY position open. If you only want to limit your bot so that you don't open another EURJPY position, then you need to search all positions that are just EURJPY.
Example:
int numPositionsAlreadyOpen = Positions.FindAll(p.Label, Symbol.Name).Count();
Hope that helps you even more :-)
@firemyst
firemyst
27 Dec 2023, 12:21
Here are some tips to get you started
Looking at the code, I see a lot of repetitive stuff that you should eliminate to reduce CPU and memory operations.
For starters:
1) you have "i * load" all over the place. That wastes at least 3 CPU cycles to reference i, reference load, and then do the multiplication. Do "i * load" ONCE at the start of the loop, save it into a local variable (that will be saved in faster memory access), and use that throughout.
2) same thing with "index - 1". Create a local variable int indexMinus1 and assign "index - 1" to it. Then use that local variable everywhere instead of having the calculation repeated over and over and over
3) Color.FromArgb(100, "A3FF6000"). Again geezsus. Set the color once in a local variable and reference that where needed instead of having the system to call that function over and over and over.
4) "stoch" + i + index : strings are immutable objects. Every time you do this, the CPU has to waste cycles creating a new string object in memory, storing it in memory, and then referencing it. Create another local variable, set it once, and then reference it throughout code. Ex: string strIdentifier = "stoch" + i + index; There. It's done once, and you've just freed up not only constant memory operations but also multiple CPU cycles.
@firemyst
firemyst
25 Dec 2023, 00:40
( Updated at: 26 Dec 2023, 09:47 )
RE: Spotware cTrader is BLOCKING me from logging in via my VPS?!
PanagiotisCharalampous said:
Hi firemyst,
As explained, we have no reason to block a specific ip address. If the site is accessible from everywhere else, then it is probably an issue of that machine not being able to reach out to the specific uri, not the site in general.
Best regards,
Panagiotis
You might not be doing it, but someone appears to be (AWS? A middle-man routing provider?) blocking, or not allowing, any addresses from the 77.90.x.x network.
My VPS provider responded that they can set up any number of fresh Windows 2019 Server VPS on the 77.90.x.x network, and it doesn't work anywhere:
https://gyazo.com/39e7237a672be8b5e5dcce07596ea304
However, they can set up VPS' on a London based network or elsewhere and it works fine:
https://gyazo.com/b61b565305b2cb46984e6a420ae9a80e
Also, doing a TRACERT on one of the 77.90 machines, this is what happens for them:

which is consistent with the errors received in the browsers (this is from Firefox this time as I've already posted errors from Chrome previously in this thread) :

So even if Spotware isn't blocking IP addresses themselves, there's definitely “network interference" going on that's preventing Spotware users of cTrader from reaching Spotware's cTrader servers, and I would think Spotware would want to take an interest in it to find out why network traffic from at least one network with the ID of 77.90 isn't being allowed to reach their servers.
@firemyst
firemyst
23 Dec 2023, 16:05
( Updated at: 23 Dec 2023, 16:13 )
RE: Spotware cTrader is BLOCKING me from logging in via my VPS?!
PanagiotisCharalampous said:
Hi firemyst,
Spotware does not block any VPS. You should contact your VPS provider instead.
Best regards,
Panagiotis
More errors from Spotware's side in the web browser. You can see the offending code is in “vendor-spotware…js”


IC Markets and Pepperstone work fine:

So it seems to be specifically related to Spotware's systems.
@firemyst
firemyst
23 Dec 2023, 09:04
( Updated at: 23 Dec 2023, 09:11 )
RE: Spotware cTrader is BLOCKING me from logging in via my VPS?!
PanagiotisCharalampous said:
Hi firemyst,
Spotware does not block any VPS. You should contact your VPS provider instead.
Best regards,
Panagiotis
See first screen capture from browser showing the errors.
How is it not an issue on Spotware's side if the browser itself is getting responses that it's timing out?
I've already spoken with the VPS provider as well. They themselves can access ct.spotware.com and the cTrader desktop from any of their other machines. I can run Pepperstone's cTrader, IC markets cTrader on the VPS, and visit any other website on from the VPS.
If it was an issue with the VPS provider, why would the browser show the error of “https://demo2.p.ctrader.com:9443/connections net:: ERR_TIMED_OUT” from the vendor-sentry.js file on https://ct.spotware.com but not https://ct.pepperstone.com/ ?
@firemyst
firemyst
19 Dec 2023, 12:04
RE: RE: 'Remove All Drawings ' does not remove all drawings!
Shares4UsDevelopment said:
firemyst said:
If you don't post screen captures or sample code reproducing the issue, how are you expecting people to help you?
No need for help! just posting a Bug.
So again, where's the sample code that reproduces the issue?
If it's a bug, you should be able to generate code that demonstrates the problem. Provide the code so people can investigate and replicate what's happening so it can be fixed.
@firemyst
firemyst
13 Jan 2024, 13:40 ( Updated at: 15 Jan 2024, 07:11 )
THis doesn't belong here.
You need to post it in the Suggestions forum:
https://ctrader.com/forum/suggestions
@firemyst