Replies

PanagiotisCharalampous
06 Aug 2024, 06:54

Hi there,

Can you please let us know which version of cTrader you use?

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
06 Aug 2024, 06:54

Hi there,

Can you please let us know which version of cTrader you use?

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
06 Aug 2024, 05:59

Hi there,

Feel free to post your suggestions in the Suggestions section below

https://ctrader.com/forum/suggestions/

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
06 Aug 2024, 05:56

RE: RE: RE: RE: RE: RE: Get symbol all time high/low

ncel01 said: 

PanagiotisCharalampous said: 

ncel01 said: 

PanagiotisCharalampous said: 

ncel01 said: 

PanagiotisCharalampous said: 

Hi there,

You would need to get all the bars from the server and check the high/low. Try M1 to save time.

Best regards,

Panagiotis

Hi Panagiotis,

How can that be achieved programmatically?

Symbol.AllTimeHigh would be straight forward but I believe there is no such property available. So, what can be a work around here?

Thank you.

Hi ncel01,

You can load all the bars by using Bars.LoadMoreHistory(). Then you can use Bars.HighPrices.Maximum(Bars.Count) and Bars.LowPrices.Minimum(Bars.Count) to get the respective high and low.

Best regards,

Panagiotis

Panagiotis,

Thanks.

Bars.LoadMoreHistory() does not seem to change anything, no matter the time frame.
On the other hand, it looks like max/min historical prices are only caught when using monthly bars : 

var bars = MarketData.GetBars(TimeFrame.Monthly);var maxHistorical = bars.HighPrices.Maximum(bars.Count);var minHistorical = bars.LowPrices.Minimum(bars.Count));

Hi there,

Note that Bars.LoadMoreHistory() currently works only in real time execution and you need to call it until it returns 0, so that all bars have been loaded.

Best regards,

Panagiotis

Right. I was testing it in real time but I was not aware that multiple calls would be (maybe) needed.

However, it looks like for shorter time frames it is not possible go as far back in time, even when all bars are loaded (Bars.LoadMoreHistory() = 0), leading to different results.

Hi ncel01,

It always depends on how much data is available by your broker.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
06 Aug 2024, 05:53

Hi there,

The most probable reason is that your conditions are never met. Try debugging your strategy to check what values you are getting from the model.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
06 Aug 2024, 05:50

RE: RE: Private link Copytrader

kaizenfx said: 

PanagiotisCharalampous said: 

Hi there,

They just need to open the link in their browser and they will be able to follow your strategy.

Best regards,

Panagiotis

Thank you for your answer, and can i add my other personnal accounts ? 

Best regards.

Yes you should be able to do this


@PanagiotisCharalampous

PanagiotisCharalampous
06 Aug 2024, 05:49

RE: RE: What kind of text?

karatedog said: 

firemyst said: 

You don't say what kind of text you're wanting to align.

That might be because newbies like me don't have a clue what kind of Text are out there, and coming from other programming languages the immediate practice is, it should not matter, it is Text at the end.

The documentation is lacking, badly organized and probably not maintained, I get constant warnings for obsolete methods when copying examples from the documentation.

This forum post was the single answer to my question as well, otherwise I would not even imagine that half of the properties for Text object is defined with the DrawText method and other half is defined on the base class properties. This is not just ugly, it makes the learning curve extremely steep. 

Thanks for the info!

 

Hi there,

Please let us know which examples are obsolete so that we can update them.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
06 Aug 2024, 05:41

RE: RE: RE: RE: When a bot was "unexpectedly terminated", cTrader shows the bot as still running

firemyst said: 

PanagiotisCharalampous said: 

firemyst said: 

PanagiotisCharalampous said: 

Hi firemyst,

Can we have the cBot that reproduces this problem?

Best regards,

Panagiotis

On a separate issue, I'm not receiving email notifications when someone responds to a post in the forums. Are they working?

The issue reported above happened again to me today. AGain the button won't click, I can't stop it. The only way for me to get out of this is to kill cTrader and restart. 

When I do that, I do know the “OnStop” even doesn't happen or register, because in my code when a bot instance stops, I have it write information to a text file. All the forex pairs (such as NZDUSD below) don't write anything out when this happens. So whatever terminates the process doesn't cause the “OnStop” even to fire.

 

I can't figure out exactly how to reproduce it, so am not sending through the full bot code. I do know it happens when I have 26 bot instances running under one instance of cTrader on a VPS using 4GB of memory making all sorts of trades and managing them. Maybe it gets hung when too many ticks come through and it can't handle them? Kind of like when debugging in Visual Studio and if we wait too long it kills the process to safeguard data. 

I'm trying to figure out code to send you that easily reproduces this behaviour all the time.

 

 

Hi firemyst,

If you want to receive notifications for responses, make sure you subscribe to the thread

Best regards,

Panagiotis

 

I started this post, thus I'm automatically subscribed. I should have received your response, but nothing. I didn't know until I was browsing today. That's why I was asking. I know about the subscribe feature. 

 

However, I received a notification about your most recent response, so that tells me 1) either you somehow responded differently over the weekend (being an admin and all) that cause me to not receive anything or 2) the service was down for some reason.

Thank you

Hi firemyst,

We didn't change anything neither we are aware of any issues. Make sure the email did not end in your spam folder.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
05 Aug 2024, 12:47

Hi there,

Could you please send us some troubleshooting information the next time this happens? Please paste a link to this discussion inside the text box before you submit it.

Best regards,

Panagiotis
 


@PanagiotisCharalampous

PanagiotisCharalampous
05 Aug 2024, 12:46

Hi there,

This happens due to lazy loading. For the Calculate() method to be called, you need to access an Output IndicatorDataSeries. Else you will need to call the method explicitly from your cBot.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
05 Aug 2024, 12:42

RE: RE: When a bot was "unexpectedly terminated", cTrader shows the bot as still running

firemyst said: 

PanagiotisCharalampous said: 

Hi firemyst,

Can we have the cBot that reproduces this problem?

Best regards,

Panagiotis

On a separate issue, I'm not receiving email notifications when someone responds to a post in the forums. Are they working?

The issue reported above happened again to me today. AGain the button won't click, I can't stop it. The only way for me to get out of this is to kill cTrader and restart. 

When I do that, I do know the “OnStop” even doesn't happen or register, because in my code when a bot instance stops, I have it write information to a text file. All the forex pairs (such as NZDUSD below) don't write anything out when this happens. So whatever terminates the process doesn't cause the “OnStop” even to fire.

 

I can't figure out exactly how to reproduce it, so am not sending through the full bot code. I do know it happens when I have 26 bot instances running under one instance of cTrader on a VPS using 4GB of memory making all sorts of trades and managing them. Maybe it gets hung when too many ticks come through and it can't handle them? Kind of like when debugging in Visual Studio and if we wait too long it kills the process to safeguard data. 

I'm trying to figure out code to send you that easily reproduces this behaviour all the time.

 

 

Hi firemyst,

If you want to receive notifications for responses, make sure you subscribe to the thread

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
05 Aug 2024, 12:40

Hi there,

cTrader does not allow US residents to use the application unless the broker is regulated in the US.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
05 Aug 2024, 06:04

Hi there,

Shariah compliant is an option that the brokers offer. You should consult with your broker if they offer shariah compliant accounts or not and what are their exact settings.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
05 Aug 2024, 06:02

RE: RE: RE: RE: Get symbol all time high/low

ncel01 said: 

PanagiotisCharalampous said: 

ncel01 said: 

PanagiotisCharalampous said: 

Hi there,

You would need to get all the bars from the server and check the high/low. Try M1 to save time.

Best regards,

Panagiotis

Hi Panagiotis,

How can that be achieved programmatically?

Symbol.AllTimeHigh would be straight forward but I believe there is no such property available. So, what can be a work around here?

Thank you.

Hi ncel01,

You can load all the bars by using Bars.LoadMoreHistory(). Then you can use Bars.HighPrices.Maximum(Bars.Count) and Bars.LowPrices.Minimum(Bars.Count) to get the respective high and low.

Best regards,

Panagiotis

Panagiotis,

Thanks.

Bars.LoadMoreHistory() does not seem to change anything, no matter the time frame.
On the other hand, it looks like max/min historical prices are only caught when using monthly bars : 

var bars = MarketData.GetBars(TimeFrame.Monthly);var maxHistorical = bars.HighPrices.Maximum(bars.Count);var minHistorical = bars.LowPrices.Minimum(bars.Count));

Hi there,

Note that Bars.LoadMoreHistory() currently works only in real time execution and you need to call it until it returns 0, so that all bars have been loaded.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
05 Aug 2024, 06:01

Hi there,

They just need to open the link in their browser and they will be able to follow your strategy.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
05 Aug 2024, 05:59

Hi there,

If the indicator does not take any parameters, then you cannot just pass a parameter and expect it to work. If you want to pass a timeframe parameter then you need to reprogram HSNind to accept a parameter and perform the relevant calculation.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
05 Aug 2024, 05:54

Hi there,

You can request all open positions using Request for Positions. The response will be a Position Report with the information you need.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
05 Aug 2024, 05:50

Hi there,

See an example below

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 StopLoss : Robot
    {
         protected override void OnStart()
          {
              Positions.Closed += PositionsOnClosed;
          }
          
          private void PositionsOnClosed(PositionClosedEventArgs args)
          {
                if(args.Reason == PositionCloseReason.StopLoss)
                {
                    Print("Stop loss triggered for position " + args.Position.Id);
                }
          }
    }
}

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
05 Aug 2024, 05:46

Hi there, 

This tool is only available in cTrader Web at the moment.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
04 Aug 2024, 06:57

Hi Viktor,

cTrader just shows the signals received by TradingCentral. If singals are missing, it means TradingCentral does not provide any for the specific symbol/timeframe.

Best regards,

Panagiotis


@PanagiotisCharalampous