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

PanagiotisCharalampous
08 Mar 2019, 10:17

Hi lec0456,

ObjectHoverChanged works for non interactive objects as well. See below how to get the index of the hovered line

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()
        {
            Chart.ObjectHoverChanged += OnChartObjectHoverChanged;
            var divLine = Chart.DrawVerticalLine("Dayend", Server.Time, Color.Orange, 1, LineStyle.DotsRare);
        }

        void OnChartObjectHoverChanged(ChartObjectHoverChangedEventArgs obj)
        {
            if (obj.IsObjectHovered)
            {
                if (Chart != null)
                    Chart.DrawStaticText("hoverText", obj.ChartObject.Name, VerticalAlignment.Top, HorizontalAlignment.Left, Chart.ColorSettings.ForegroundColor);
                if (obj.ChartObject is ChartVerticalLine)
                    Print("Index " + (obj.ChartObject as ChartVerticalLine).Time);
            }
            else
                Chart.RemoveObject("hoverText");
        }

        protected override void OnTick()
        {
            // Put your core logic here
        }

        protected override void OnStop()
        {
            // Put your deinitialization logic here
        }
    }
}

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
08 Mar 2019, 09:53

Hi dmn,

We have investigated this issue and it seems you are using a custom indicator (I-Sessions) which causes the memory issue. Can you try removing the indicator and letting us know if it resolves the issue?

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
08 Mar 2019, 09:32

Hi daniel.agg,

Thanks for posting in our forum. I downloaded the cBot but there is no source code. Can you please send it with source code? Also you can just post the code here, no need to send files.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
07 Mar 2019, 17:59

Hi ctid1032297,

Thanks for posting in our forum. Renko and Range bars are not available yet.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
07 Mar 2019, 17:55

Hi Sasha,

Yes it is a bug and we are aware about it. I just wanted to make sure it is the one we know. It happens on optimization when cBots get data form other timeframes than the one they execute on.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
07 Mar 2019, 16:59

Hi Sasha,

I have checked your cBot and you are using data from another timeframe

       [Parameter("S & R TimeFrame", DefaultValue = "Daily")]
        public TimeFrame SRTimframe { get; set; }
.
.
.

     seriesSR = MarketData.GetSeries(SRTimframe);
.
.
.
.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
07 Mar 2019, 16:20

RE: IsOverlay not work as previous version did.

uvwxyz said:

Hi,

Previously one could use in the Indicators opened chart's tool : f / Custom and overlay a custom indicator B ( built with declaration: "IsOverlay = true;) over another custom indicator A (which is already displayed in a panel), by selecting (in the  f / Custom dialouge box)  B as the 'Indicator' and selecting an output series of indicator A as the input series (source) for indicator B.

Now doing so draws the Indicator B on the main chart which is useless, and also takes away a lot of power of cTrader custom indicators. Previously it drew on the panel of Indicator A.

Can you please, make this previously available funtionality available again.

Cheers.

Hi abs,

This is a bug and we will fix it.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
07 Mar 2019, 16:01

Hi Ben,

There is no other feature at the moment.You can try double clicking on the Trend Line and choose Show Angle. This feature will help you drawing a straight line.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
07 Mar 2019, 14:19

RE: RE:

bart1 said:

lec0456 said:

I would like to have some text appear on the chart when the mouse rolls over a chart object such as a Chart.DrawVerticalLine.

Is there a way to program this behavior?

Basically, I would think that there is some sort of event that couls be triggered to display a box of text.

The indicators do this by default now.  When you rollover a chart object it displays a small popup that has the name of the indicator, its settings and its current value.

protected override void OnStart()
{
    Chart.ObjectHoverChanged += OnChartObjectHoverChanged;
}

void OnChartObjectHoverChanged(ChartObjectHoverChangedEventArgs obj)
{
    if (obj.IsObjectHovered)
        Chart.DrawStaticText("hoverText", obj.ChartObject.Name, VerticalAlignment.Top, HorizontalAlignment.Left, Chart.ColorSettings.ForegroundColor);
    else
        Chart.RemoveObject("hoverText");
}

 

Hi Bart,

That could work as well but you still need to distinguish which exact object is hovered, either by location or by name or any other unique property.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
07 Mar 2019, 14:03

RE:

Waxy said:

Thanks for your hard work Spotware,

I have questions,

Why this feature works with custom enums being parametrizable, but not built-in enums like HorizontalAlignment, and others? I hope is available soon also.
Note: Currently I can build a custom enum and then cast to a built-in enum, that's what I can do for now.

Also, will you wait for 3.6 before launching 3.5 as the official version?

Thank you

 

Hi Xavier,

Works fine for me

using System;
using System.Linq;
using System.Windows.Forms;
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 CustomcBot : Robot
    {
        [Parameter()]
        public cAlgo.API.HorizontalAlignment Alignment { get; set; }

        protected override void OnStart()
        {

        }

        protected override void OnTick()
        {

        }
        protected override void OnStop()
        {
            // Put your deinitialization logic here
        }
    }
}

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
07 Mar 2019, 13:53

Hi lec0456,

I have no problem running the code below

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

namespace cAlgo
{
    [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class NewIndicator : Indicator
    {
        [Parameter(DefaultValue = 0.0)]
        public double Parameter { get; set; }

        [Output("Main")]
        public IndicatorDataSeries Result { get; set; }


        protected override void Initialize()
        {
            // Initialize and create nested indicators
        }

        public override void Calculate(int index)
        {
            var divLine = Chart.DrawVerticalLine("Dayend" + index, index, Color.Orange, 1, LineStyle.DotsRare);
            Print(divLine.Time);
        }
    }
}

Besr Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
07 Mar 2019, 11:46

Hi El Antonio,

Position.SymbolCode is available, it is just not appearing in Intellisense. You can still use it though.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
07 Mar 2019, 10:52

Hi matayas,

Thanks for posting in our forum. Can you please tell us on which broker's cTrader is this happening? When it happens again, please send us some troubleshooting information (press Ctrl+Alt+Shift+T, paste the link to this discussion in the text box and press submit). Also, you might want to have a look at Spotware cTrader Beta and let us know if it happens there as well.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
07 Mar 2019, 09:57

Hi lec0456,

There is no direct way to do this but with a bit of code in Chart.Mouse move event I believe this is achievable. See below

        protected override void Initialize()
        {
            Chart.MouseMove += Chart_MouseMove;
        }

        private void Chart_MouseMove(ChartMouseEventArgs obj)
        {
           
        }

in the Chart_MouseMove() function you can monitor the obj.TimeValue and obj.YValue, and if they are in proximity to the relevant object, display your pop up.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
07 Mar 2019, 09:48

Hi El Antonio,

Here is the correct way

            TradeResult Result1 = ExecuteMarketOrder(TradeType.Buy, Symbol.Name, 1, "jo", 1, 1, "1");
            TradeResult Result2 = ExecuteMarketOrder(TradeType.Buy, this.Symbol, 1, "jo", 1, 1, 1);
            TradeResult Result3 = ExecuteMarketOrder(TradeType.Buy, Symbol, 1, "jo", 1, 1, 1);

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
07 Mar 2019, 09:35

Hi hoabg102,

Thanks for posting in our forum. The functions you use are obsolete. Please try the ones in the example below

            Chart.DrawHorizontalLine("LongTargetLine", Symbol.Bid + (Symbol.PipSize * 2), Color.Lime, 1, LineStyle.Lines);
            Chart.DrawText("LongText", "Long Target", Server.Time, Symbol.Bid + (Symbol.PipSize * 3), Color.Lime);

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
07 Mar 2019, 09:25

Hi Psak,

The problem is these lines

            ma = dxx.A(MarketSeries.Close, 27, MovingAverageType.Exponential);
            ma5 = dxx.A(series5.Close, 27, MovingAverageType.Exponential);
            ma10 = dxx.A(series10.Close, 27, MovingAverageType.Exponential);

They don't make any sense and I cannot help you if you do not explain to me what are you trying to do here. If you delete them, your indicator will build without problems.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
06 Mar 2019, 15:36

Hi Psak,

Thanks but you did not answer my question. What are you trying to do in the lines Ι quoted above? Are you trying to initialize the indicator? If yes, then this is wrong. You need to use Indicators.GetIndicator<>() function. You can read more about it here, in the Referencing Custom Indicators section.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
06 Mar 2019, 15:17

Hi Nasser,

Not yet. It is currently under development.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
06 Mar 2019, 15:03

Hi guys, 

We plan to improve this in a future update and allow simultaneous sign in to different cTIDs. 

Best Regards,

Panagiotis


@PanagiotisCharalampous