Replies

K100
29 Jul 2022, 13:27

RE:

Nevermind. Found an alternate solution

 

K100 said:

Hi,

Since updating since yesterday. Code that was working fine is no longer, and i'm not sure why. Its so basic.

If i remove this snippet , indicator works. Any ideas ?


if (AUD[index] == double.NaN)
{
    AUD[index] = 0;
    IndicatorArea.DrawText("Text1", "AUD: " + index, index , 0, audColor);
}
else if (AUD[index] != double.NaN)
{
  IndicatorArea.DrawText("Text1", "AUD: " + index, index , AUD[index], audColor);
}
 

Keep getting the following error.

"Crashed in Calculate with ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: y. Actual value was: NaN."

 

Thanks in advance

 


@K100

K100
24 Jul 2020, 09:31

RE:

PanagiotisCharalampous said:

Hi K100,

Can you provide steps that we can follow to reproduce the problem?

Best Regards,

Panagiotis 

Join us on Telegram

Hi Panagiotis ,

Have you had a chance to look at this issue ?

 

Thanks,

Hans


@K100

K100
22 Jul 2020, 12:29 ( Updated at: 21 Dec 2023, 09:22 )

RE:

PanagiotisCharalampous said:

Hi K100,

Can you provide steps that we can follow to reproduce the problem?

Best Regards,

Panagiotis 

Join us on Telegram

 

Hi, 

 

Can you see the 2 images below.

The one changes as you click between the price entry and pips entry and the other doesn't.

So price stays locked to pips and not locked to price.

Hope that is clear.

 


@K100

K100
20 Jul 2020, 14:28 ( Updated at: 21 Dec 2023, 09:22 )

RE:

PanagiotisCharalampous said:

Hi K100,

Make sure you are not using trailing stop loss.

Best Regards,

Panagiotis 

Join us on Telegram

 

Hi,

 

No its not the trailing stoploss. There is something different between the builds. In the latest version i have from Purple trading. When i click the price area , it doesn't change from est. Price to Price, and visa versa with clicking pips - it should change from est. Pips to Pips. In the version of Ctrader i have from IC Market that is how it functions. I updated the Purple trading version of Ctrader last week, i believe to 3.8... 


@K100

K100
06 Apr 2020, 10:42

RE:

PanagiotisCharalampous said:

Hi K100,

See below

using System;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;

namespace cAlgo.Robots
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class NewcBot : Robot
    {
        [Parameter(DefaultValue = 0.0)]
        public double Parameter { get; set; }

        protected override void OnStart()
        {
            var bars = MarketData.GetBars(TimeFrame.Daily);
            bars.BarOpened += OnBarsBarOpened;
        }
        
        void OnBarsBarOpened(BarOpenedEventArgs obj)
        {
            Print("D1 Bar Opened");
        }
    }
}

 

Best Regards,

Panagiotis 

Join us on Telegram

 

Great ! Thanks.


@K100

K100
04 Apr 2020, 05:51

RE:

PanagiotisCharalampous said:

Hi K100,

If the bar change event of your custom data series is different than the standard timeframe, then you will need to develop this logic yourself.

Best Regards,

Panagiotis 

Join us on Telegram

 

Would you be able to provide me some sample code on the Bars.BarOpened event , there is little documentation or discussion in the forum about it.

Maybe i can still try it ?

Many thanks for your assistance.


@K100

K100
03 Apr 2020, 14:30

RE:

PanagiotisCharalampous said:

Hi K100,

I am not sure what do you mean. With MarketData.GetBars() you can get the bars for another timeframe. Then using Bars.BarsOpened you can subscribe to the event raised each time a new bar is added to this collection. Isn't this what you are looking for?

Best Regards,

Panagiotis 

Join us on Telegram

The issue is that, i'm using the MarketData.GetBars() and then transforming that data - and moving it into a dataseries. So the alert i need needs to be referencing the price data from the Dataseries. I've created one Dataseries for each of the timeframes. So i need and way to subscribe to the lower timeframe dataseries for alerts while viewing the Chart in a normal 15minute timeframe...  Is that more clear ?

 


@K100

K100
03 Apr 2020, 13:38

RE:

PanagiotisCharalampous said:

Hi K100,

You can use Bars.BarOpened event to check bar changes for bars on other timeframes.

Best Regards,

Panagiotis 

Join us on Telegram

 

I'm using a Dataseries, as the Bars data i am using has been manipulated, (as in i have some additional maths applied to the MarketData.GetBars) --  So i'm not sure this will work or am i misunderstanding the method ?

I've created a dataseries for the OHLC - am i able to create my own Bars data for this work ?

 


@K100

K100
05 Mar 2020, 09:31

RE:

PanagiotisCharalampous said:

Hi Hans,

You need to use DrawStaticText instead.

Best Regards,

Panagiotis 

Join us on Telegram

 

Great. Thank you


@K100

K100
05 Mar 2020, 09:30

RE:

PanagiotisCharalampous said:

Hi Hans,

No there is no such option. Another approach would be to use multiple IndicatorDataSeries with different color on each and add values only to the series with the relevant color each time.

Best Regards,

Panagiotis 

Join us on Telegram

 

Thanks.


@K100