Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

News/word scanner/reader

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    News/word scanner/reader

    Trying to make a news/word reader/scanner but keep getting "}expected" after the OnBarUpdate method when compiling. Appreciate help on why. Tnx!

    //Fredrik

    #region
    Using declarations
    ...

    using System.Net;
    using System.IO;

    #endregion
    ...
    protectedoverridevoid OnBarUpdate()
    {
    // START

    class GetPage
    {
    public String DownloadPage(Uri url)
    {
    WebRequest http = HttpWebRequest.Create(url);
    HttpWebResponse response = (HttpWebResponse)http.GetResponse();
    StreamReader stream =
    new StreamReader(response.GetResponseStream(),System.T ext.Encoding.ASCII );
    String result = stream.ReadToEnd();
    response.Close();
    stream.Close();
    return result;
    }
    publicvoid Go(String page)
    {
    Uri u =
    new Uri(page);
    String str = DownloadPage(u);
    Console.WriteLine(str);
    }
    [STAThread]
    staticvoid Main(string[] args)
    {
    GetPage module =
    new GetPage();
    String page;
    if (args.Length == 0)
    page =
    "http://di.se/";
    else
    page = args[0];
    module.Go(page);
    }

    // STOP
    }
    #region Properties
    #endregion
    }
    ...

    #2
    Hello Free,

    Interesting concept - thanks for sharing. This is unfortunately beyond our scope of support but you will likely need to clean up the code blocks. Simplify and work on one section at a time until it works as you expect.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Tnx, I´ll look into that. The idea is simply to scan major news sites/feeds for words/phrases that can be devided into beeing "bullish" or "bearish". That would easily be graphed in a "Media Sentiment" indicator.

      Any help appreciated!

      //Fredrik
      Last edited by FREEN; 12-22-2010, 02:12 PM.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by f.saeidi, Today, 08:01 PM
      0 responses
      2 views
      0 likes
      Last Post f.saeidi  
      Started by Rapine Heihei, Today, 07:51 PM
      0 responses
      3 views
      0 likes
      Last Post Rapine Heihei  
      Started by frslvr, 04-11-2024, 07:26 AM
      5 responses
      96 views
      1 like
      Last Post caryc123  
      Started by algospoke, 04-17-2024, 06:40 PM
      6 responses
      49 views
      0 likes
      Last Post algospoke  
      Started by arvidvanstaey, Today, 02:19 PM
      4 responses
      11 views
      0 likes
      Last Post arvidvanstaey  
      Working...
      X