Topics
Replies
stuart
08 Mar 2023, 12:42
RE:
pick said:
The issue is that you aren't storing a value for each index. Within each if block, you're only choosing to assign the value to one of the two series, so the other will be unpopulated. Also, I can imagine there will be cases where neither if block is entered (if close prices are equal), so both will be unpopulated at that index.
I believe that it may also be an issue that you're not setting the current index, you're always setting the one prior. I believe the sum function goes up to and includes the final value.
Try this change and see if you get a usable result:
public override void Calculate(int index) { // HLGreenBars[index] = 0; HLRedBars[index] = 0; // if (index > lastIndex) {
Yes, that was it.. thank you :-)
@stuart
stuart
28 Feb 2023, 06:38
RE:
Spotware said:
Dear trader,
All .NET 6.0 libraries are supported. Unfortunately we do not have a guide for this specific case.
Best regards,
cTrader Team
Hi,
bump
Any chance you can see why this library will not work with .NET 6.0?
I have bots that I have to run as .NET 4.0
Is it a Threading issue?
do we need to do something with the Connection?
@stuart
stuart
25 Jan 2023, 07:26
RE:
firemyst said:
What provider and version of cTrader are you using?
And just to be sure, you've been trying to change your indicator names in the left panel when you click on "automate"?
Hi,
Thank you for replying.
I use v4.4.23 with IC Markets but also have v4.5.6 with FTMO
I am using the left panel to Rename the file, like i have done many times.
I either get access denied error . hxxps://www.screencast.com/t/WccsUMr2PxDU (change xx to tt to view)
or a permissions error: see: hxxps://www.screencast.com/t/AWr5mjTt (change xx to tt to view)
Both my username and SYSTEM have Full Control in security of the folder. But Read Only is always checked, even if I uncheck and allow the explorer to change files and folders.
I would appreciate any pointers/ideas to help debug this one.
@stuart
stuart
21 Feb 2022, 11:16
RE:
ok thank you for your reply. and also for the code, that gives me a good idea.
Stuart
amusleh said:
Hi,
There is no API feature that allows you to load a bar tick data.
For new real time bars you can record each bar tick data by using OnTick or Calculate method.
For historical bars there is no practical way to do this, you can load the tick data of a symbol and then filter each bar tick data by using its open time but loading all historical bars tick data can get lots of time.
As an example:
using System.Linq; using cAlgo.API; using cAlgo.API.Internals; using System.Collections.Generic; namespace cAlgo.Robots { [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] public class NewcBot : Robot { private readonly Dictionary<int, Tick[]> _barTicks = new Dictionary<int, Tick[]>(); protected override void OnStart() { var ticks = MarketData.GetTicks(); // This can take very long time based on number of bars and their time frame while (ticks[0].Time > Bars[0].OpenTime) { var loadTicksNumber = ticks.LoadMoreHistory(); if (loadTicksNumber < 1) break; } Print(ticks[0].Time, " | ", Bars[0].OpenTime, " | ", ticks.Count, " | ", Bars.Count); // For historical bars for (int barIndex = 0; barIndex < Bars.Count; barIndex++) { Tick[] barTicks; if (barIndex == Bars.Count - 1) { barTicks = ticks.Where(tick => tick.Time >= Bars[barIndex].OpenTime).ToArray(); } else { barTicks = ticks.Where(tick => tick.Time >= Bars[barIndex].OpenTime && tick.Time < Bars.OpenTimes[barIndex + 1]).ToArray(); } _barTicks.Add(barIndex, barTicks); } // Now each bar ticks are stored inside _barTicks dictionary and you can access them with bar index Print("All bars ticks are saved on _barTicks"); } } }
@stuart
stuart
14 Jul 2019, 08:43
The cBot will not show the indicator, as far as I know.
you need to manually add that indicator as you normally would. and set the settings the same as you have then in your bot to have any meaning.
it feels odd that you need to do it separately but i think its the only way.
@stuart
stuart
29 Jun 2019, 12:53
RE:
stuart said:
I am trying to get Chart.DrawText() to draw text under each candle.
but i only get text on the most recent candle [index]
in Calculate() i have
Chart.DrawText("UPDOWN", i.ToString(), i, MarketSeries.Low[i] - 5, "#8fb300");
how do i get it to work on each candle?
I tried the Obsolete ChartObjects.DrawText and it works as expected.
so why does the new Chart.DrawText not work the same way?
i feel like we are in the dark with these updates.
@stuart
stuart
28 Jan 2018, 09:08
( Updated at: 28 Jan 2018, 09:09 )
tick data misses the purpose of the renko blocks
have a look at
http://stockcharts.com/school/doku.php?id=chart_school:chart_analysis:renko
you see the irregular date axis?
you only get a block one your set amount of price movements have happened.
the insight is really cool. you can see the movement with out the noise so to speak.
Vote this in. or even the ability to code it up. by releasing the x,y axis
@stuart
stuart
07 Oct 2023, 08:45
Thank you to AKS on telegram for finding the issue :-)
There is a bug with HttpRequest where it does not set the Header “Content-Type”
So if you need it as part of the API call you can add a directive to httpd.conf (apache) to force all requests to have the header you need.
But its a bug that needs fixing..
@stuart