
Topics
Replies
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
12 Mar 2019, 19:48
Hello Panagiotis,
This may get the default color specified using LineColor = Color, however, if the user changes the color or line-style this is not possible to retrieve, it should be able to get the properties the user has changed, not the one hard coded, I think this is a bug.
The code below prints Red despite I'm changing it to various colors.
Thanks for your support,
using System; using System.Reflection; 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 ReadOutputAttribute : Indicator { [Parameter(DefaultValue = 0.0)] public double Parameter { get; set; } [Output("Main", LineColor = "Red")] public IndicatorDataSeries Result { get; set; } Color _myColor; protected override void Initialize() { } public override void Calculate(int index) { PropertyInfo[] props = typeof(ReadOutputAttribute).GetProperties(); foreach (PropertyInfo prop in props) { object[] attrs = prop.GetCustomAttributes(true); foreach (object attr in attrs) { OutputAttribute outputAttr = attr as OutputAttribute; if (outputAttr != null) { if (outputAttr.LineColor != null) { Print(outputAttr.LineColor.ToString()); _myColor = Color.FromName(outputAttr.LineColor.ToLower()); } else Print("Line Color is null"); } } } Chart.DrawStaticText("Text", "This text changes color", VerticalAlignment.Top, HorizontalAlignment.Right, _myColor); } } }
@Waxy
Waxy
07 Mar 2019, 07:01
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
@Waxy
Waxy
13 Nov 2018, 02:08
Hello Panagiotis,
Sadly, the problem just faded away without any explanation, tho I did re-install cTrader and Visual Studio, the issue persisted. It suddenly it works now, how odd, I must have done something, or the software must have received an update.
It didn't have anything to do with custom robots, because it was occurring even with a new bot with a default code.
I'll use this topic if the issue shows up again in the future.
Thanks for your support,
@Waxy
Waxy
06 Sep 2018, 20:25
Hello Panagiotis,
Thanks for your response, hope Spotware changes its mind in the future, I think this is a good feature to have, a good example would be what Microsoft does with Visual Studio
Best Regards,
@Waxy
Waxy
23 Jul 2018, 22:01
Hello Spotware,
This looks great and will help us develop better tools for trades.
I have two requests I haven't seen but been asking for it.
- Opacity for objects, this is important because chart data is sometimes blocked by these objects.
- Have an option to have objects drawn on backtests, but interactivity disabled.
Thanks for your continuous work.
@Waxy
Waxy
07 Jul 2018, 16:18
All you had to do is to change "Buy" for "Sell" and update the price to have both
For Buy
//If there is not a buystop order place a buy stop order if (PendingOrders.Count(item => item.OrderType == PendingOrderType.Stop && item.TradeType == TradeType.Buy) == 0) { PlaceStopOrder(TradeType.Buy, Symbol, 1000, Symbol.Ask + 100 * Symbol.PipSize); }
For Sell
//If there is not a buystop order place a buy stop order if (PendingOrders.Count(item => item.OrderType == PendingOrderType.Stop && item.TradeType == TradeType.Sell) == 0) { PlaceStopOrder(TradeType.Sell, Symbol, 1000, Symbol.Bid - 100 * Symbol.PipSize); }
@Waxy
Waxy
29 Jun 2018, 09:17
Here's a simple example:
using cAlgo.API; using cAlgo.API.Indicators; using cAlgo.API.Internals; namespace cAlgo.Robots { [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] public class Examples : Robot { SimpleMovingAverage SlowMA, FastMA; Position Pos; protected override void OnStart() { SlowMA = Indicators.SimpleMovingAverage(MarketSeries.Close, 100); FastMA = Indicators.SimpleMovingAverage(MarketSeries.Close, 50); } protected override void OnBar() { bool direction = FastMA.Result.Last(1) > SlowMA.Result.Last(1); TradeType tT = direction ? TradeType.Buy : TradeType.Sell; if (Positions.Count == 0) { Pos = ExecuteMarketOrder(tT, Symbol, 1000).Position; } else { if((Pos.TradeType == TradeType.Buy && !direction) || (Pos.TradeType == TradeType.Sell && direction)) ClosePosition(Pos); } } } }
@Waxy
Waxy
01 Jun 2018, 02:04
( Updated at: 21 Dec 2023, 09:20 )
Hello Panagiotis,
The error is shown when I build from VS2017:
In the end, it says: Process doesn't have access to file because it's being used by another process.
I must close VS and click Build on cTrader for these errors to become warnings, I think it's a bug.
Now without VS2017 Open:
@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