Topics
Replies
moneybiz
23 May 2016, 10:35
RE:
tmc. said:
I came across same issue with offset giving me wrong values. Try following snippet, it worked for me.
TimeSpan offset = TimeZoneInfo.Local.GetUtcOffset(DateTime.UtcNow);
Doesn't this give your local time offset from UTC? It doesn't have anything to do with server's UTC offset.
@moneybiz
moneybiz
19 May 2016, 23:52
RE: RE: RE: RE: RE: RE: RE: RE:
fm1975a1 said:
No it's downloading the data, but Excel CSV file can contain about only 1.048 Million rows, which is just couple of months of data from 2012, and maybe it'll be possible to add another sheets or files, or extend the rows it can contain but then the second problem is that this DumpToCSV bot gives me the OHLC data, which in this all fourth are the same value, and it's not both bid and ask data which is what i need.. and also the CSV file is 2.99GB for just several months of data, so it should be about 50GB of data for 2012-2016 OHLC tick data.. it's all so sucks.. with my former broker, i could download all data with bid and ask prices, even 50 years back of daily OHLC bid and ask, with not all that mess and difficulties.. is there any way to do that here? please?..
I use a database to store the data and call whenever I want whatever date range I want.
In your case the simplest solution would be to write the month by month. Like 2016_01.csv, 2016_02.csv, ...
The data from 2012-11 to 2016-03 is around 2.31GB. Don't try to open that file with notepad or something. Just use code to read from it or seperate everything to monthly files.
In OnTick() event you only need to read the Time, Symbol.Bid and Symbol.Ask values and write them to file.
These 3 values are the only thing you need. I don't know how your bot constructs the OHLC data. You don't need OHLC.
@moneybiz
moneybiz
16 May 2016, 13:49
RE: RE: RE: RE: RE: RE:
Okay i tried that, but after clicked that play button it loaded days X / 1300+ days and nothing from there.. I don't know how to operate this cAlgo at all..can you tell me exactly what to do to get the file?.. I got only DumpToCSV bot and one who saves the live ticks to Excel file.. Should i add some other bot or something?..
I don't that bot. But if it is coded properly it should save all the tick data for 1300+ days. If it doesn't contact the developer.
@moneybiz
moneybiz
12 May 2016, 11:18
( Updated at: 21 Dec 2023, 09:20 )
RE: RE: RE: RE:
Hi.. Sorry but i know almost nothing about the cAlgo programming or loading and stuff.. Can you tell me exactly please, how to get that 2012 and on tick data to excel file? i'll take it from there..
Click on the marked places.
@moneybiz
moneybiz
12 May 2016, 02:32
cTrader FIX Engine
Rules of Engagement
Version 2.1
May 201
This documentation is not well documented and needs examples for all of the requests/responses supported.
For example few unknowns;
1) How is the "BodyLength" calculated?
2) Is "MsgSeqNum" increased on every request or it is fixed to 1 as indicated in the documentation?
3) Is "CheckSum" always 054 as it is documented on or always 000 as it is in the example?
@moneybiz
moneybiz
11 May 2016, 20:00
RE: RE:
fm1975a1 said:
Hello and thanks for the reply sir.. The bot you talking about, is it exporting to excel file History prices for time frames i.e. Hourly daily etc.. I got robot that showing the ticks data for both bid and ask, but that is not what i need.. So if this bot can exporting bid and ask history data for some time frame, i'll really like that.. or if there's an option to get tick Bid Ask for very far back, like several years, although it's very unlike cause obviously it's huge amount of data, but if there's, i could code one that break it down to Days or Hours or other Time frames OHLC data..
So thanks again and have a nice day.. much appreciated..
You can get tick data since 2012 november from cAlgo.
Load your tick saving bot and run backtesting from 2012 november till the current date.
All the tick data will be fed to your bot.
Later with that tick data you can build your own bars of whatever duration you want. You can build 30 seconds bars, 123 ticks bars, etc. but not on cAlgo, you have to make your own tester.
If you want to save bar and tick data together just override OnBar() method and save the last 2 tick data received before OnBar() for close of the previous bar and oppening of the new. You you'll have ticks that close a bar and open a new one.
@moneybiz
moneybiz
07 May 2016, 23:00
You can use OnTick() event to get the bid and ask prices.
Override the method and then you can get the price pair from Symbol.Bid/Ask object to accomplish what you want.
Then load your bot for backtesting.
From the settings icon choose tick data as source. Then select the date ranges you want the prices for from above (you will see it somewhere over the settings icon) and run the bot.
It will download the ticks for the range from the server and the OnTick() event will fire for each tick received. Save the values to some file.
Don't forget to add "AccessRights = AccessRights.FileSystem" attribute to the top of your robot otherwise you won't be able to access the file system.
If you can't make it I can post my bot that I'm using to do exactly what you're trying to do.
public string Delimiter { get; set; } protected override void OnTick() { base.OnTick(); var logEvent = $"{Time:yyyy-MM-dd HH:mm:ss.fff}{Delimiter}{Symbol.Bid}{Delimiter}{Symbol.Ask}"; _writer.WriteLine(logEvent); }
@moneybiz
moneybiz
26 Jan 2016, 13:04
You can try the Memory Manager Bot.
It frees the memory on specified intervals.
@moneybiz
moneybiz
18 Dec 2015, 21:57
ExecutionContext.Run may help.
What do you want to achieve? Can you be more specific?
At first I thought you wanted to execute code via BeginInvoke of the cAlgo window.
Unfortunately I couldn't succeeded because I couldn't convert the window handle to System.Windows.Forms.Control object. Probably because cAlgo window is not System.Windows.Forms.Control type object.
Anyway, here is the code.
using System; using System.IO; using System.Runtime.InteropServices; using System.Threading; using System.Windows.Forms; using cAlgo.API; namespace MoneyBiz.Trader.Indicators { [Indicator(IsOverlay = false, TimeZone = TimeZones.EEuropeStandardTime, AccessRights = AccessRights.FullAccess)] public abstract class ControlIndicator : Indicator { protected override void Initialize() { } public override void Calculate(int index) { var executionContext = ExecutionContext.Capture(); ExecutionContext.Run(executionContext, state => { File.WriteAllLines(@"D:\Test.txt", new[] { string.Format("index: {0}", index) }); }, null); } private void FindWindowInvoke(int index) { var handle = FindWindow(null, "Spotware cAlgo"); if (handle == IntPtr.Zero) { Print("Couldn't find cAlgo window."); return; } // control is always null, the reason could be because handle is not from System.Windows.Forms.Control instance. var control = Control.FromHandle(handle); if (control == null) { return; } Action run = () => { File.WriteAllLines(@"D:\Test.txt", new[] { string.Format("index: {0}", index) }); }; control.BeginInvoke(run); } [DllImport("user32.dll", SetLastError = true)] private static extern IntPtr FindWindow(string lpClassName, string lpWindowName); [DllImport("user32.dll", SetLastError = true)] private static extern IntPtr FindWindowEx(IntPtr hWndParent, IntPtr hWndChildAfter, string lpClassName, string lpWindowName); } }
@moneybiz
moneybiz
18 Oct 2015, 17:10
RE:
ironmine said:
This is what I found: Google gives 60 (!!!) days free test period, you can get a computing cloud and run a quite powerful computer for backtesting and optimization using Remote Desktop Connection. I do it now. Even after the free test period, the charges are quite low and flexible. By the way, latency to Pepperstone is 6 ms :)
Is it Windows OS?
@moneybiz
moneybiz
07 Oct 2015, 19:55
How do you create the SslStream?
First you need to establish a tcp connection, then you get the network stream from that connection which you use to create a ssl stream.
I think ssl stream's function is to encrypt messages and send/receive them over a network stream All the network stuff is handled by network stream.
What kind of error message do you receive to claim that it's not thread safe?
@moneybiz
moneybiz
07 Oct 2015, 02:17
You confused me in the begining, actually you don't need to worry about performing read and write simultaneously. It's built-in supported.
"SslStream is not guaranteed to be thread safe" must be for the public members. You don't need to worry about that, you'll be using NetworkStream object.
TcpClient class has a GetStream() method which returns a NetworkStream object.
The documentation says:
Read and write operations can be performed simultaneously on an instance of the NetworkStream class without the need for synchronization. As long as there is one unique thread for the write operations and one unique thread for the read operations, there will be no cross-interference between read and write threads and no synchronization is required.
TcpClient client; var networkStream = client.GetStream(); var sslStream = new SslStream(ns, false);
@moneybiz
moneybiz
06 Oct 2015, 21:23
It's not hard to do but you need to learn C# and cAlgo to code your own bots since you're asking for complete robot.
If you don't want to learn or need some assistance there are people who can help you.
There is a member named Paul Hayes (and maybe others too), as far as I remember he is giving coding lessons as well as teaches how to code robots in cAlgo.
If you want you can check his profile or you can ask for help in jobs section.
No money no honey. :)
@moneybiz
moneybiz
05 Oct 2015, 02:35
( Updated at: 21 Dec 2023, 09:20 )
Maybe there are some tasks waiting for other tasks to finish and since waiting doesn't use CPU as working tasks it's reasonable to have less than 100% CPU usage.
Try to move the resources slider to the right to let the cAlgo to use more CPU.
@moneybiz
moneybiz
30 May 2016, 01:59
The version of IC Markets cAlgo is: 1.35.64939
@moneybiz