Announcement

Collapse
No announcement yet.

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 Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      576 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      334 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      553 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      551 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X