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 kinfxhk, 07-14-2026, 09:39 AM
      0 responses
      125 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 07-13-2026, 10:18 AM
      0 responses
      105 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 07-13-2026, 09:50 AM
      0 responses
      85 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 07-13-2026, 07:21 AM
      0 responses
      105 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 07-11-2026, 02:11 AM
      0 responses
      84 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Working...
      X