PanagiotisCharalampous's avatar
PanagiotisCharalampous
26 follower(s) 0 following 1006 subscription(s)
Replies

PanagiotisCharalampous
14 Apr 2024, 08:15

Dear Matt,

Please provide us with the exact steps you follow to reproduce this behavior so that we can explain what happens. If you can record a video, it would be helpful.

Best regards,

Panagiotis

 


@PanagiotisCharalampous

PanagiotisCharalampous
14 Apr 2024, 08:12

Hi there,

Price feeds are a responsibility of the broker. Please talk to them.

Regarding the dates, months change on UTC+3 timezone. So if you want to see the starting date as the first day of the month, you need to change your timezone to UTC+3.

Best regards,

Panagiotis

 


@PanagiotisCharalampous

PanagiotisCharalampous
14 Apr 2024, 08:09

Hi there,

We will respond to your email.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
14 Apr 2024, 08:07

RE: RE: RE: RE: RE: RE: RE: RE: RE: RE: Custom indicator with TimeFrame.Hour4 not showing Last(1) value in cBot.

ys2310 said: 

PanagiotisCharalampous said: 

ys2310 said: 

PanagiotisCharalampous said: 

ys2310 said: 

PanagiotisCharalampous said: 

ys2310 said: 

PanagiotisCharalampous said: 

ys2310 said: 

PanagiotisCharalampous said: 

Hi there,

This happens because you only assign values to indicator data series, when the index of each higher timeframe changes. Hence for the rest of the array elements the value stays NaN. The solution to this depends on what you want to achieve. For example, why do you 

@PanagiotisCharalampous

Thank you for your reply. I want to test my GMMA strategy with multi-timeframe.

My cBot staretegy is 1hour resolution and should be able to access to the above custom indicator(multi-timeframe GMMA)'s TimeFrame.Hour4 Last(n) values. 

Can you me an example on how to code this correctly?

Hi there,

I am sorry but I cannot write the code for you. If you have specific questions, I am happy to answer them. At the moment I do not see a reason to leave the data series values to NaN.

Best regards,

Panagiotis

Hello Panagiotis,

What do you mean by “At the moment I do not see a reason to leave the data series values to NaN.” ?

I made some mistakes in my code?

Can you share the cBot code as well so that I can tell you exactly where the problem is?

Hi Panagiotis,

Yes, I can share the cBot code to you.

here it is.

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;using cAlgo.Indicators;namespace cAlgo.Robots{    [Robot(AccessRights = AccessRights.FullAccess, TimeZone = TimeZones.TokyoStandardTime)]    public class GMMASingle : Robot    {                     private GMMA _gmma;                      protected override void OnStart()        {            // To learn more about cTrader Automate visit our Help Center:            // https://help.ctrader.com/ctrader-automate                                    _gmma = Indicators.GetIndicator<GMMA>();                    }        protected override void OnBar()                {                                    Print(_gmma.LongEma1.Last(1)," ",_gmma.LongEma4.Last(1)); // <--- prints NaN NaN                        if (_gmma.LongEma1.IsRising() && _gmma.LongEma4.IsRising()) {                    ExecuteMarketOrder(TradeType.Buy, Symbol.Name, 100, "GMMA", null, null);            }            if (_gmma.LongEma1.IsFalling() && _gmma.LongEma4.IsFalling()) {                    ExecuteMarketOrder(TradeType.Sell, Symbol.Name, 100, "GMMA", null, null);            }        }        protected override void OnStop()        {            // Handle cBot stop here        }                    }}

 

Hi there,

Here is a visualization of your problem using the debugger

Your Indicator data series have NaN values because you do not assign anything to them when the time does not match the higher timeframe time. Hence the problems in your logic. 

I do not understand why you have created a separate indicator for this and have to manage all this complexity. You could just initialize the moving averages inside your cBot and use them.

Best regards,

Panagiotis

Hi Panagiotis,

Thank you for the screenshot. I see the problem now.

I changed my cBot code as following and it seems to print higher time frame values correctly. 

However, how can I display, for example, this _longEma2 onto my bachtest chart?

private MovingAverage _longEma1, _longEma2, _longEma3, _longEma4; protected override void OnStart(){      _longEma1 = Indicators.ExponentialMovingAverage(MarketData.GetSeries(TimeFrame.Hour2).Close, 200);      _longEma2 = Indicators.ExponentialMovingAverage(MarketData.GetSeries(TimeFrame.Hour4).Close, 200);      _longEma3 = Indicators.ExponentialMovingAverage(MarketData.GetSeries(TimeFrame.Hour8).Close, 200);      _longEma4 = Indicators.ExponentialMovingAverage(MarketData.GetSeries(TimeFrame.Hour12).Close, 200);}

It's not possible to add them on the chart from the cBot but you could use your GMMA indicator for this purpose

Hi Panagiotis,

So, in this my case scenario, we need to use my custom GMMA indicator during backtest.

The problem is how to solve the NaN values things. 

I'd like to get TimeFrame.Hour4 moviing average values in my 1 hour backtest resolution.

How can I do this correctly?

So, in this my case scenario, we need to use my custom GMMA indicator during backtest.

No you just need to use for visualization purposes. To solve the NaN issue requires some complicated code to be written. I cannot provide you guidance except than actually writing the code for, something I cannot afford to do at the moment.


@PanagiotisCharalampous

PanagiotisCharalampous
12 Apr 2024, 11:52

Hi there,

“Order Execution Error Nothing to change” means that the property you are trying to modify has the same value as the previous one.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
12 Apr 2024, 11:50

RE: RE: RE: RE: RE: RE: RE: RE: Custom indicator with TimeFrame.Hour4 not showing Last(1) value in cBot.

ys2310 said: 

PanagiotisCharalampous said: 

ys2310 said: 

PanagiotisCharalampous said: 

ys2310 said: 

PanagiotisCharalampous said: 

ys2310 said: 

PanagiotisCharalampous said: 

Hi there,

This happens because you only assign values to indicator data series, when the index of each higher timeframe changes. Hence for the rest of the array elements the value stays NaN. The solution to this depends on what you want to achieve. For example, why do you 

@PanagiotisCharalampous

Thank you for your reply. I want to test my GMMA strategy with multi-timeframe.

My cBot staretegy is 1hour resolution and should be able to access to the above custom indicator(multi-timeframe GMMA)'s TimeFrame.Hour4 Last(n) values. 

Can you me an example on how to code this correctly?

Hi there,

I am sorry but I cannot write the code for you. If you have specific questions, I am happy to answer them. At the moment I do not see a reason to leave the data series values to NaN.

Best regards,

Panagiotis

Hello Panagiotis,

What do you mean by “At the moment I do not see a reason to leave the data series values to NaN.” ?

I made some mistakes in my code?

Can you share the cBot code as well so that I can tell you exactly where the problem is?

Hi Panagiotis,

Yes, I can share the cBot code to you.

here it is.

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;using cAlgo.Indicators;namespace cAlgo.Robots{    [Robot(AccessRights = AccessRights.FullAccess, TimeZone = TimeZones.TokyoStandardTime)]    public class GMMASingle : Robot    {                     private GMMA _gmma;                      protected override void OnStart()        {            // To learn more about cTrader Automate visit our Help Center:            // https://help.ctrader.com/ctrader-automate                                    _gmma = Indicators.GetIndicator<GMMA>();                    }        protected override void OnBar()                {                                    Print(_gmma.LongEma1.Last(1)," ",_gmma.LongEma4.Last(1)); // <--- prints NaN NaN                        if (_gmma.LongEma1.IsRising() && _gmma.LongEma4.IsRising()) {                    ExecuteMarketOrder(TradeType.Buy, Symbol.Name, 100, "GMMA", null, null);            }            if (_gmma.LongEma1.IsFalling() && _gmma.LongEma4.IsFalling()) {                    ExecuteMarketOrder(TradeType.Sell, Symbol.Name, 100, "GMMA", null, null);            }        }        protected override void OnStop()        {            // Handle cBot stop here        }                    }}

 

Hi there,

Here is a visualization of your problem using the debugger

Your Indicator data series have NaN values because you do not assign anything to them when the time does not match the higher timeframe time. Hence the problems in your logic. 

I do not understand why you have created a separate indicator for this and have to manage all this complexity. You could just initialize the moving averages inside your cBot and use them.

Best regards,

Panagiotis

Hi Panagiotis,

Thank you for the screenshot. I see the problem now.

I changed my cBot code as following and it seems to print higher time frame values correctly. 

However, how can I display, for example, this _longEma2 onto my bachtest chart?

private MovingAverage _longEma1, _longEma2, _longEma3, _longEma4; protected override void OnStart(){      _longEma1 = Indicators.ExponentialMovingAverage(MarketData.GetSeries(TimeFrame.Hour2).Close, 200);      _longEma2 = Indicators.ExponentialMovingAverage(MarketData.GetSeries(TimeFrame.Hour4).Close, 200);      _longEma3 = Indicators.ExponentialMovingAverage(MarketData.GetSeries(TimeFrame.Hour8).Close, 200);      _longEma4 = Indicators.ExponentialMovingAverage(MarketData.GetSeries(TimeFrame.Hour12).Close, 200);}

It's not possible to add them on the chart from the cBot but you could use your GMMA indicator for this purpose


@PanagiotisCharalampous

PanagiotisCharalampous
12 Apr 2024, 06:43

Hi there,

It will be added in a future release.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
12 Apr 2024, 06:12

RE: RE: RE: RE: RE: RE: Custom indicator with TimeFrame.Hour4 not showing Last(1) value in cBot.

ys2310 said: 

PanagiotisCharalampous said: 

ys2310 said: 

PanagiotisCharalampous said: 

ys2310 said: 

PanagiotisCharalampous said: 

Hi there,

This happens because you only assign values to indicator data series, when the index of each higher timeframe changes. Hence for the rest of the array elements the value stays NaN. The solution to this depends on what you want to achieve. For example, why do you 

@PanagiotisCharalampous

Thank you for your reply. I want to test my GMMA strategy with multi-timeframe.

My cBot staretegy is 1hour resolution and should be able to access to the above custom indicator(multi-timeframe GMMA)'s TimeFrame.Hour4 Last(n) values. 

Can you me an example on how to code this correctly?

Hi there,

I am sorry but I cannot write the code for you. If you have specific questions, I am happy to answer them. At the moment I do not see a reason to leave the data series values to NaN.

Best regards,

Panagiotis

Hello Panagiotis,

What do you mean by “At the moment I do not see a reason to leave the data series values to NaN.” ?

I made some mistakes in my code?

Can you share the cBot code as well so that I can tell you exactly where the problem is?

Hi Panagiotis,

Yes, I can share the cBot code to you.

here it is.

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;using cAlgo.Indicators;namespace cAlgo.Robots{    [Robot(AccessRights = AccessRights.FullAccess, TimeZone = TimeZones.TokyoStandardTime)]    public class GMMASingle : Robot    {                     private GMMA _gmma;                      protected override void OnStart()        {            // To learn more about cTrader Automate visit our Help Center:            // https://help.ctrader.com/ctrader-automate                                    _gmma = Indicators.GetIndicator<GMMA>();                    }        protected override void OnBar()                {                                    Print(_gmma.LongEma1.Last(1)," ",_gmma.LongEma4.Last(1)); // <--- prints NaN NaN                        if (_gmma.LongEma1.IsRising() && _gmma.LongEma4.IsRising()) {                    ExecuteMarketOrder(TradeType.Buy, Symbol.Name, 100, "GMMA", null, null);            }            if (_gmma.LongEma1.IsFalling() && _gmma.LongEma4.IsFalling()) {                    ExecuteMarketOrder(TradeType.Sell, Symbol.Name, 100, "GMMA", null, null);            }        }        protected override void OnStop()        {            // Handle cBot stop here        }                    }}

 

Hi there,

Here is a visualization of your problem using the debugger

Your Indicator data series have NaN values because you do not assign anything to them when the time does not match the higher timeframe time. Hence the problems in your logic. 

I do not understand why you have created a separate indicator for this and have to manage all this complexity. You could just initialize the moving averages inside your cBot and use them.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
12 Apr 2024, 05:54

Hi Mat,

It should be in your account's deposit currency.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
11 Apr 2024, 13:14

RE: RE: RE: RE: Custom indicator with TimeFrame.Hour4 not showing Last(1) value in cBot.

ys2310 said: 

PanagiotisCharalampous said: 

ys2310 said: 

PanagiotisCharalampous said: 

Hi there,

This happens because you only assign values to indicator data series, when the index of each higher timeframe changes. Hence for the rest of the array elements the value stays NaN. The solution to this depends on what you want to achieve. For example, why do you 

@PanagiotisCharalampous

Thank you for your reply. I want to test my GMMA strategy with multi-timeframe.

My cBot staretegy is 1hour resolution and should be able to access to the above custom indicator(multi-timeframe GMMA)'s TimeFrame.Hour4 Last(n) values. 

Can you me an example on how to code this correctly?

Hi there,

I am sorry but I cannot write the code for you. If you have specific questions, I am happy to answer them. At the moment I do not see a reason to leave the data series values to NaN.

Best regards,

Panagiotis

Hello Panagiotis,

What do you mean by “At the moment I do not see a reason to leave the data series values to NaN.” ?

I made some mistakes in my code?

Can you share the cBot code as well so that I can tell you exactly where the problem is?


@PanagiotisCharalampous

PanagiotisCharalampous
11 Apr 2024, 12:47

RE: RE: Custom indicator with TimeFrame.Hour4 not showing Last(1) value in cBot.

ys2310 said: 

PanagiotisCharalampous said: 

Hi there,

This happens because you only assign values to indicator data series, when the index of each higher timeframe changes. Hence for the rest of the array elements the value stays NaN. The solution to this depends on what you want to achieve. For example, why do you 

@PanagiotisCharalampous

Thank you for your reply. I want to test my GMMA strategy with multi-timeframe.

My cBot staretegy is 1hour resolution and should be able to access to the above custom indicator(multi-timeframe GMMA)'s TimeFrame.Hour4 Last(n) values. 

Can you me an example on how to code this correctly?

Hi there,

I am sorry but I cannot write the code for you. If you have specific questions, I am happy to answer them. At the moment I do not see a reason to leave the data series values to NaN.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
11 Apr 2024, 11:54

RE: RE: Chart.DrawHorizontalLine() on cTrader mobile app chart

ncel01 said: 

PanagiotisCharalampous said: 

Hi ncel01,

No, the applications do not synchronize.

Best regards,

Panagiotis

Hi Panagiotis,

Thanks for informing!

That's a pity. It would be great to be aware of some key levels through the mobile app chart.

Are there any plans to implement this in the future?

The teams are considering this but it's a huge project. It would take time


@PanagiotisCharalampous

PanagiotisCharalampous
11 Apr 2024, 11:53

Hi there,

Both values are inclusive.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
11 Apr 2024, 11:51

Hi there,

Thank you for reporting this issue. Unfortunately we were not able to reproduce this behavior. 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
11 Apr 2024, 11:45

Hi there,

This happens because you only assign values to indicator data series, when the index of each higher timeframe changes. Hence for the rest of the array elements the value stays NaN. The solution to this depends on what you want to achieve. For example, why do you 


@PanagiotisCharalampous

PanagiotisCharalampous
11 Apr 2024, 11:26

RE: RE: bot stops working after some time

swingfish said: 

PanagiotisCharalampous said: 

Hi swingfish,

Do OnTick() and OnBar() get triggered? Do your methods still get called? Does the code get blocked somewhere else?

The bot uses both OnBar() and onTimer() but it's a choice i can make in a setting to make via a setting.

the bot does print a status text on the chart its deployed, and this does stop updating, so i guess the OnBar,OnTick and OnTimer are not called anymore.

when i stop the bot it takes much longer for it to stop, and when i start it again it does work just fine for some time.

and yes like you wrote it surely has somethings to do with my terrible code, i just don't know how to diagnose it.

it does write a file, calculates exposure and displays it, keeps profit/loss in a variable thats written to the filesystem.

it also has a feature to auto-hedge and other things, but all those things are disabled via settings and are never called.

i could add some printouts but those would create alot of log-traffic and the whole loop is running rather quickly as it really just writes the file OnBar only (this is to prevent too much harddisc traffic) and otherwise just recalculates the risk values based on realtime data such as equity/balance/and so on.

Hi swingfish,

Any change it gets stuck in a loop or gets locked by waiting sore resource to be released e.g an open file? Just throwing ideas around since I have no idea about the specifics of your cBot.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
11 Apr 2024, 06:35

Hi there,

Custom watchlists are not supported for cTrader for Mac at the moment.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
11 Apr 2024, 05:46

Hi there, 

You need to provide more specific information regarding what you are doing. As a starting point, try connecting using the FIX API Example application. If the connection is successful, then compare it with your implementation and find what you are doing different. If you cannot connect using the FIX API Example, please provide us with more information (host name, account, credentials, messages exchanged etc) so that we can test it as well.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
11 Apr 2024, 05:43

Hi there,

Try using cMAM

https://clickalgo.com/ctrader-trade-copy

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
11 Apr 2024, 05:39

Hi there,

Yes, the team is currently working on this feature.

Best regards,

Panagiotis


@PanagiotisCharalampous