Topics
Replies
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
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
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
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
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