Topics
30 Aug 2024, 11:09
 0
 163
 0
15 Aug 2024, 13:12
 0
 151
 0
23 Jul 2024, 17:30
 0
 233
 0
02 Jun 2024, 00:49
 2
 362
 3
14 Apr 2024, 00:05
 359
 4
15 Jan 2024, 06:08
 482
 3
Replies

Waxy
27 Nov 2019, 00:23

I think I have sorted this out, by building inside Visual Studio without clicking build again in cTrader the Debug mode will not be overridden.


@Waxy

Waxy
27 Sep 2019, 19:16 ( Updated at: 21 Dec 2023, 09:21 )

I'm not sure if this is a bug or a feature, the text is shown above the price axis, how can I edit or fix this? Chart.Width should not consider this axis area.

Thanks for your support.


@Waxy

Waxy
18 Sep 2019, 08:49

Thanks for replying,

I'm sorry, what I was actually trying to suggest by improving RemoveChild() is that it should have an overload to just remove by index [Column,Row], or know by these if a "cell" has any child in it, we can make workarounds for it, but it would be nice to have it.

Thanks for the font tips as well.
Best Regards,
Xavier R.


@Waxy

Waxy
17 Sep 2019, 07:45

Hello Panagiotis, thanks for your support.

Can you tell me which FamilyFont types are supported? it seems I have to guess, enums for this would be nice.

Another suggestion, the grid should be improved to access and edit objects by index [row, colum], I don't see options to do this, there are only options to remove entire rows or columns.

The .AddChild() property includes row, column parameters, but the .RemoveChild() does not.

I hope this or something similar gets added before 3.6 is released.

Thanks

 


@Waxy

Waxy
16 Aug 2019, 02:25

Hello Spotware, thanks for these additions, they are really helpful.

I have two questions:

What is the "IsHitTestVisible" property for? can we get an example?

My second question might be a request also, it seems we can't modify the grid lines inside a Grid, it would be nice to change the style, width, and color, I can use BorderPanel to circumvent this issue for the moment.


Best Regards,


@Waxy

Waxy
15 May 2019, 20:04

Add the namespace System.
 

using System;

 


@Waxy

Waxy
28 Apr 2019, 19:44

Hello Panagiotis,

I will send it, thanks for your support.


@Waxy

Waxy
18 Apr 2019, 23:08 ( Updated at: 21 Dec 2023, 09:21 )

Hello Panagiotis,

I apologize, let me explain:

It is supposed that this event is fired every time you scroll through the chart, right?, however, it's being fired constantly without any interaction with the chart whatsoever, it's a bit erratic, I'm not sure what triggers it.


@Waxy

Waxy
17 Apr 2019, 18:09

My bad tho, I tried it and it doesn't work outside forms, the one built in cTrader is enough for most tasks I think.


@Waxy

Waxy
15 Apr 2019, 21:52

You can do:
 

         protected override void OnStart()
        {
            Timer.Start(TimeSpan.FromMilliseconds(100));
        }
        
        protected override void OnTimer()
        {
            Print("Test");
        }

 

If you need more timers you could use the Timer inside System.Windows.Forms, I read that is also single threaded, read the documentation here:
https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.timer?view=netframework-4.7.2

The timers inside System.Timers are not single threaded and I think they're not safe.


@Waxy

Waxy
12 Apr 2019, 22:35

Hello,

I'm the one who made this code long ago, I will update it, see the code below.
 

using cAlgo.API;
 
namespace cAlgo
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class OCO : Robot
    {
        //---ORDER 1

        [Parameter("Order #1 Type")]
        public string InputOrderType1 { get; set; }

        [Parameter("Order #1 Price", DefaultValue = 1.0)]
        public double InputOrderPrice1 { get; set; }

        [Parameter("Order #1 Size", DefaultValue = 10000)]
        public double InputOrderSize1 { get; set; }

        [Parameter("Order #1 SL", DefaultValue = 20)]
        public double InputStopLoss1 { get; set; }

        [Parameter("Order #1 TP", DefaultValue = 40)]
        public double InputTakeProfit1 { get; set; }
 
        //---ORDER 2
 
        [Parameter("Order #2 Type")]
        public string InputOrderType2 { get; set; }

        [Parameter("Order #2 Price", DefaultValue = 1.0)]
        public double InputOrderPrice2 { get; set; }

        [Parameter("Order #2 Size", DefaultValue = 10000)]
        public double InputOrderSize2 { get; set; }

        [Parameter("Order #2 SL", DefaultValue = 20)]
        public double InputStopLoss2 { get; set; }

        [Parameter("Order #1 TP", DefaultValue = 40)]
        public double InputTakeProfit2 { get; set; }
 
        private string _label;
 
        protected override void OnStart()
        {
            _label = string.Format("{0}{1}{2}", Symbol.Code, TimeFrame, Server.Time.Ticks);
            PendingOrders.Filled += PendingOrders_Filled;

            if (InputOrderType1.ToLower() == "sell")
            {
                if (InputOrderPrice1 > MarketSeries.Close.LastValue)
                    PlaceLimitOrder(TradeType.Sell, Symbol, InputOrderSize1, InputOrderPrice1, _label, InputStopLoss1, InputTakeProfit1);
                else
                    PlaceStopOrder(TradeType.Sell, Symbol, InputOrderSize1, InputOrderPrice1, _label, InputStopLoss1, InputTakeProfit1);
            }
            else if (InputOrderType1.ToLower() == "buy")
            {
                if (InputOrderPrice1 > MarketSeries.Close.LastValue)
                    PlaceStopOrder(TradeType.Buy, Symbol, InputOrderSize1, InputOrderPrice1, _label, InputStopLoss1, InputTakeProfit1);
                else
                    PlaceLimitOrder(TradeType.Buy, Symbol, InputOrderSize1, InputOrderPrice1, _label, InputStopLoss1, InputTakeProfit1);
            }
            else
            {
                Print("Parameter not recognized, bot will stop");
                Stop();
            }
 
            if (InputOrderType2.ToLower() == "sell")
            {
                if (InputOrderPrice2 > MarketSeries.Close.LastValue)
                    PlaceLimitOrder(TradeType.Sell, Symbol, InputOrderSize2, InputOrderPrice2, _label, InputStopLoss2, InputTakeProfit2);
                else
                    PlaceStopOrder(TradeType.Sell, Symbol, InputOrderSize2, InputOrderPrice2, _label, InputStopLoss2, InputTakeProfit2);
            }
            else if (InputOrderType2.ToLower() == "buy")
            {
                if (InputOrderPrice2 > MarketSeries.Close.LastValue)
                    PlaceStopOrder(TradeType.Buy, Symbol, InputOrderSize2, InputOrderPrice2, _label, InputStopLoss2, InputTakeProfit2);
                else
                    PlaceLimitOrder(TradeType.Buy, Symbol, InputOrderSize2, InputOrderPrice2, _label, InputStopLoss2, InputTakeProfit2);
            }
            else
            {
                Print("Parameter not recognized, bot will stop");
                Stop();
            }
        }

        private void PendingOrders_Filled(PendingOrderFilledEventArgs obj)
        {
            if (obj.PendingOrder.Label != _label)
                return;

            foreach (PendingOrder order in PendingOrders)
            {
                if (order.Label == _label)
                {
                    CancelPendingOrder(order);
                }
            }
        }

        protected override void OnTick()
        {

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

 


@Waxy

Waxy
02 Apr 2019, 00:17

cTrader 3.5 is currently in Beta

The official version is 3.3 and doesn't support it yet.


@Waxy

Waxy
26 Mar 2019, 19:46

Sorry the right answer is the last one, forum doesn't allow to edit post.


@Waxy

Waxy
26 Mar 2019, 19:45

private bool isNearTargetSignal()

{
    if (pos == null) return false;
 

    if (pos.TradeType == TradeType.Buy)

    {

        if (sym.Bid > pos.TakeProfit - (sym.PipSize * TriggerPips))

            return true;

    }

    else if (pos.TradeType == TradeType.Sell)

    {

        if (sym.Ask < pos.TakeProfit + (sym.PipSize * TriggerPips))

            return true;

    }

    return false;

}


@Waxy

Waxy
26 Mar 2019, 19:45

private bool isNearTargetSignal()
{
    if (pos == null)
    

    if (pos.TradeType == TradeType.Buy)
    {
        if (sym.Bid > pos.TakeProfit - (sym.PipSize * TriggerPips))
            return true;
    }
    else if (pos.TradeType == TradeType.Sell)
    {
        if (sym.Ask < pos.TakeProfit + (sym.PipSize * TriggerPips))
            return true;
    }
    return false;
}

 


@Waxy

Waxy
20 Mar 2019, 19:36

Hello!

Please allow the use of Description Attribute to enums so they could be easily readable, i.e:
 

using System.ComponentModel; 

public enum MyEnum 
{ 
    [Description("value 1")] 
    Value_1, 
    [Description("value 2")]
    Value_2, 
    [Description("value 3")]
    Value_3
}


Thanks for your hard work.


@Waxy

Waxy
19 Mar 2019, 07:57

I think maybe adding these parameters to IndicatorDataSeries would a better option, reflection shouldn't be used for this in my opinion, and also is not enough because it doesn't get the values if they are changed.

Please consider fixing this for 3.6

Thanks for your support


@Waxy

Waxy
14 Mar 2019, 22:28

I would like to clear out some items in this post, cTrader 3.5 has been good, so far.
 

1.       Give us the option to make folders for indicators/cbots

2.       Improve performance of cBots/Indicators list (Too slow to load when you have many indicators, it often freezes)

3.       Let us pic Font Size and Bold type for Drawing Text

4.       Give more ZoomIn/ZoomOut options for the chart, a couple more up and down.

5.       Allow the Indicators to print and send info to the log (in Trader mode this doesn't work)

6.       Allow a DeInitialization for Indicators, or programmatic removal.

7.       Let Indicators access other indicator chart objects, just like you let us any bot access any other bot trades, so I think this should be consistent, currently if I try to find an object like a rectangle made from another indicator, it's out of reach.

8.       Allow for other Static Objects like StaticText, i.e. StaticRectangle, or better yet:

1.       Give (x,y) coordinates to chart area so we can set up specific locations and not just VerticalAlignment/HorizontalAlignment, the current API based on barIndex and price is Ok and serves for some scenarios, but it fails and I have to make it update itself when the chart is scrolled, so an (x,y) static option is really needed.

9.       Parameter Inputs for all default enums in the API, also for the new Color class, and custom enums, I know this is under development currently.

1.       Color (Which is a class currently)

2.       LineStyle

3.       Custom Enums

4.       TradeType

5.       PlotType

6.       And others

10.    If it's possible, allow us to run multiple timers in parallel, and not just one.

11.    Loading multiple symbol data takes too long, I would like to use Parallel.Foreach() to retrieve other MarketSeries faster but it's not allowed, it throws an error.

12.    Allow Change Chart/Open a new Chart on click.

13.    API able to retrieve all symbols allowed by the platform.

14.    A better MarketHours property, on which you can filter sessions like London, New York, etc (This is already visible on the bottom left of the platform)


@Waxy

Waxy
13 Mar 2019, 13:15

Hello Panagiotis,

Thanks for your support, please make this a feature in the future, I need to update object colors from the settings picked by the user with Output Attribute.

Best Regards,


@Waxy

Waxy
13 Mar 2019, 05:44

Hello

As far as I know, this only works inside the Automate Section.


@Waxy