Click here to Login





                                                   JSON downloader

Back to threads - Tags: --
  0

0
David Pellon
2016-07-23 05:15:55


I am trying to create a downloader that gets some JSON data the following mode

[
[
1417478400000,
380.94,
387.7,
378.75,
384.61,
6857.31
],
....
....
....
]

Seems in the what's new in version 3.0.1 it said
- Added functions in the "Net" class to read JSON data (Example: Reads JSON data in the downloader and easily parses it)

Do we have any example of this?

Thansk



Alexander Horn
2016-07-24 06:19:31

  0

David, you can directly use following library: Newtonsoft.json.dll, quite poweful for serializing arrays or structs into jsons, or reading back. http://www.newtonsoft.com/json

We use a lot, also good for passing complex global vars

Example:

Product product = new Product();
product.Name = "Apple";
product.Expiry = new DateTime(2008, 12, 28);
product.Sizes = new string[] { "Small" };

string json = JsonConvert.SerializeObject(product);
// {
// "Name": "Apple",
// "Expiry": "2008-12-28T00:00:00",
// "Sizes": [
// "Small"
// ]
// }

string json = @"{
'Name': 'Bad Boys',
'ReleaseDate': '1995-4-7T00:00:00',
'Genres': [
'Action',
'Comedy'
]
}";

Movie m = JsonConvert.DeserializeObject<Movie>(json);

string name = m.Name;
// Bad Boys




QuantShare
2016-07-24 06:23:45

  0

In the "Pre Script" you can parse JSON data like this:

for(int i=0;i<Content.Rows.Length;i++)
{
Content.Rows[i].IsIgnoreLine = true;
}

JsonData data = Content.Net.ReadJsonData(Content.GetContent());



David Pellon
2016-07-27 18:22:39

  0

Awesome. Thanks a lot


No more messages
0




Reply:

No html code. URLs turn into links automatically.

Type in the trading objects you want to include: - Add Objects
    To add a trading object in your message, type in the object name, select it and then click on "Add Objects"










    QuantShare

    Trading Items
    Survivorship bias-free S&P 500 database downloader
    Economic Series Downloader
    Tiingo IEX Intraday Downloader
    CryptoCompare Daily Downloader
    Simfin Quarterly Balance Sheet Downloader

    How-to Lessons
    How to automatically start a downloader every few minutes?
    How to debug a downloader
    How to automate the data downloading process
    How to execute a script at regular intervals
    How to plot the number of stock tweets per day

    Related Forum Threads
    Date conversion error on Json downloader
    Inserting today's date in Downloader field?
    Bse sectoral Indices downloader
    Finviz Downloader
    Insider Data Downloader

    Blog Posts
    How to filter quotes data from high and low price spikes
    Getting Accurate Backtesting Results: Survivorship bias-free S&P ...
    Diversify your portfolio by investing in stocks from various indu...
    How to create buy and sell trading rules based on News Data
    Step by step on how to get free realtime/delayed data for stocks,...









    QuantShare
    Product
    QuantShare
    Features
    Create an account
    Affiliate Program
    Support
    Contact Us
    Trading Forum
    How-to Lessons
    Manual
    Company
    About Us
    Privacy
    Terms of Use

    Copyright © 2025 QuantShare.com
    Social Media
    Follow us on Facebook
    Twitter Follow us on Twitter
    Google+
    Follow us on Google+
    RSS Trading Items



    Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.