Replies

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

PanagiotisCharalampous
06 Mar 2019, 14:05

Hi Vitore,

Unfortunately there isn't at the moment.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
06 Mar 2019, 12:47

Hi Ron77,

I am not aware of any cBot that does this at the moment. Maybe other community members can help you with this.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
06 Mar 2019, 12:43

Hi Ron77,

There is no built in feature in cTrader for OCO orders. You can create a cBot for this.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
06 Mar 2019, 11:04

Hi darcome, 

You can see the version of your cTrader on the form's title on the top. 3.5 is only available in Spotware Beta at the moment. You can see what is new in Help > What's New section.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
06 Mar 2019, 10:52

Hi Psak,

You did not provide the complete indicator code. Also, this part of the code does not make sense.

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

Would you like to explain to what are you trying to do here?

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
06 Mar 2019, 10:41

Hi Lyubomirfoto,

Thanks for posting in our forum. This has been caused due to the latest update we released yesterday and it is experienced only by users using .Net framework 4.0. We will release a fix soon. If you want to resolve the issue immediately, you can upgrade to a newer version of .Net framework.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
06 Mar 2019, 10:41

Hi TraDerMaTriX,

This has been caused due to the latest update we released yesterday and it is experienced only by users using .Net framework 4.0. We will release a fix soon. If you want to resolve the issue immediately, you can upgrade to a newer version of .Net framework.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
06 Mar 2019, 10:25

Hi dmn,

Please use Suggestions section for your suggestions. Else they will be lost amongst other threads.

Best Regards,

Panagiotis


@PanagiotisCharalampous