Topics
Replies

firemyst
01 Mar 2025, 05:59 ( Updated at: 02 Mar 2025, 22:25 )

Ctrader tends to keep the chart where you last scrolled to. So don't scroll it. :-)

However in your code, you can try the ScrollToX method:

https:// help . ctrader. com /ctrader-algo/references/Chart/Chart/#scrollxby


@firemyst

firemyst
01 Mar 2025, 03:22

Post a screen capture.

When you select an indicator and hit ok after the config dialog, it automatically shows up on your chart, or below it, depending on what you specified.


@firemyst

firemyst
01 Mar 2025, 03:19

Don't believe you can. Ctrader doesn't have the ability to remember drawing defaults.


@firemyst

firemyst
01 Mar 2025, 03:17

Why don't you Google the order type to see what it means?

 

Sometimes self discovery is a wonderful thing 😁


@firemyst

firemyst
01 Mar 2025, 03:15

Keep in mind different brokers could have different minimum sizes.

 

For instance, I know some brokers have a minimum lot size of 0.1 for indices, whereas others allow 0.01.


@firemyst

firemyst
01 Mar 2025, 03:13

Check ✔️ mark means symbol is trading.

 

Red or green means it's trading up or down


@firemyst

firemyst
01 Mar 2025, 03:10

Can you post a screen capture? For all we know you might not have them visible 👁️


@firemyst

firemyst
01 Mar 2025, 03:09

Can you post a video somewhere showing this?


@firemyst

firemyst
01 Mar 2025, 03:07

You need to post this in n the suggestions forum. This is for support only. Spotware doesn't come here looking for suggestions.


@firemyst

firemyst
01 Mar 2025, 02:57

Would be nice if you post this in the suggestions forum where it belongs 


@firemyst

firemyst
01 Mar 2025, 02:55

So how do you expect anyone to help you if you don't post code that reproduces the issue you're experiencing?


@firemyst

firemyst
01 Mar 2025, 02:53

Use Visual Studio, Visual Studio Code, or some other development platform to compile the code. You can easily copy error messages from them.

 

Or perhaps just read the error message, try to comprehend it, and fix yourself? 

 

AI isn't the be all end all 🤪


@firemyst

firemyst
01 Mar 2025, 02:51

Two suggestions from me:

 

  1. Don't run the bot in the cloud. There's too many people having too many issues. Run it locally, especially if you're just testing and playing around.
  2. The obsolete issue. Ignore it. Compile it anyway without the protection type parameter. It'll still run. That's what I've done when editing code in Visual Studio. Spotware has yet to post documentation or respond to threads asking what the protection type parameter is, or does.

@firemyst

firemyst
01 Mar 2025, 02:13

RE: RE: RE: RE: RE: Help with error code

rohanlal019@gmail.com said: 

firemyst said: 

rohanlal019@gmail.com said: 

I have found the problem. When entering a trade, cTrader is using a completely different asset's price to calculate unrealized PnL, triggering an immediate exit of the trade. i.e. I enter a long at a price point of 1.5 on NZDUSD and then it immediately exits at a 3000 pip loss because the asset ctrader is tracking for that trade is now EURNZD and EURNZD's price is currently .7.

There must be a bug in the new version of cTrader causing this to happen.

Wow. How did you figure this out?

Looking at the close and open prices in the trade history tab and the fact that the close price wasn't even a price that currency had been to before. But it was a price that one of my other Symbols in my cbot was at on that day the trade closed. 

Good work on trying to track it down.

 

It wouldn't surprise me if there was yet another major bug in the cTrader - their quality control and testing has gone to crap. It's almost like they don't care or take pride in their product any more. 


@firemyst

firemyst
28 Feb 2025, 21:21

RE: RE: RE: Help with error code

rohanlal019@gmail.com said: 

I have found the problem. When entering a trade, cTrader is using a completely different asset's price to calculate unrealized PnL, triggering an immediate exit of the trade. i.e. I enter a long at a price point of 1.5 on NZDUSD and then it immediately exits at a 3000 pip loss because the asset ctrader is tracking for that trade is now EURNZD and EURNZD's price is currently .7.

There must be a bug in the new version of cTrader causing this to happen.

Wow. How did you figure this out?


@firemyst

firemyst
27 Feb 2025, 02:19

Your suggestion won't be noticed by Spotware as this is technical support forum.

You need to post what you would like in the suggestions forum:

/forum/suggestions/

 


@firemyst

firemyst
26 Feb 2025, 01:58

What does it print when you add the following lines before the ExecuteMarketOrder statement?

Print("TP {0} + ( {1} * {2} ) = {3} ", Symbol.Bid, TakeProfitInPips, Symbol.PipSize, Symbol.Bid + (TakeProfitInPips * Symbol.PipSize) )

Print("SL {0} - ( {1} * {2} ) = {3} ", Symbol.Bid, StopLossInPips, Symbol.PipSize, Symbol.Bid + (StopLossInPips * Symbol.PipSize) )

 

Then after the ExecuteMarketOrder statement, find the position and print the SL and TP values to confirm they've been set as expected.

 

Show us a screen capture showing the before and after values from the logging. Let's see what they say.

 

 


@firemyst

firemyst
26 Feb 2025, 01:47

Why don't you post some code demonstrating the problem and perhaps someone can see what you're doing and what needs to be corrected? 

In a nutshell, when the history loads, check if the earlier bar loaded is before a certain date/time. IF not, you need to call load more history again.

If you Google, you'll see there's been a few threads in the forums talking about this:

/forum/cbot-support/38020/

/forum/indicator-support/24356/

 

And this page will have info assisting on how to load more history:

https:// help . ctrader . com /ctrader-algo/references/EventArgs/BarsHistoryLoadedEventArgs/

 


@firemyst

firemyst
26 Feb 2025, 01:25

RE: RE: Why is my cbot lagging a few candles than tradingview?

duynguyenhl.bio said: 

firemyst said: 

People can't make comparisons not knowing what the Trading View code is. For all we know, the C# code you have, while doing something, might not be 100% accurate with the Pine Code for the Trading View indicator.

I fixed it already. Btw, you can find the indicator add to chart on Trading View and click to Source code (nearby name of indicator) to knowing the code is.

  1. what was the issue?
  2. Nobody's going to want to hunt down a Trading View indicator, look at the code, and figure things out, especially if they only use cTrader. This is evidenced by the lack of response to this thread. General rule of thumb is when you need assistance, all the information should be supplied here – don't ask for help, and then expect people to go out searching for everything they need to help you.

@firemyst

firemyst
25 Feb 2025, 04:10

As a work around, you can code your own PSAR indicator to do this.

In the indicator, just get the values from the current PSAR indicator, and then draw the symbol/icon on the chart you'd like for that value.


@firemyst