Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Can not get any response from chart

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

    Can not get any response from chart

    I am in the begining...
    Trying to write first code and have initial respons...

    What is wrong with the code below' I can not have any response.

    Thanks,
    Aviram




    #region Using declarations
    using System;
    using System.ComponentModel;
    using System.Diagnostics;
    using System.Drawing;
    using System.Drawing.Drawing2D;
    using System.Xml.Serialization;
    using NinjaTrader.Cbi;
    using NinjaTrader.Data;
    using NinjaTrader.Indicator;
    using NinjaTrader.Strategy;
    #endregion
    namespace NinjaTrader.Strategy
    {

    publicclass aaaaaaaaa : Strategy
    {

    protectedoverridevoid Initialize()
    {
    Add(
    "ES 06-12", PeriodType.Minute, 60);
    Add(
    "TF 06-12", PeriodType.Minute, 60);
    }

    protectedoverridevoid OnBarUpdate()
    {
    DrawHorizontalLine(
    "tag1",500, Color.Red);

    }
    }
    }

    #2
    Hello Aviram,
    You are drawing a horizontal line at price level $500. neither ES or NQ trades at that value.

    If you replace your code with the below code can you get the horizontal line.
    Code:
    if (BarsInProgress == 0) DrawHorizontalLine("tag1",Close[0], Color.Red);


    Please let me know if I can assist you any further.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Joydeep M.

      Thanks a lot.

      Done it as requested, No response.
      Code below...


      #region
      Using declarations
      using System;
      using System.ComponentModel;
      using System.Diagnostics;
      using System.Drawing;
      using System.Drawing.Drawing2D;
      using System.Xml.Serialization;
      using NinjaTrader.Cbi;
      using NinjaTrader.Data;
      using NinjaTrader.Indicator;
      using NinjaTrader.Strategy;
      #endregion
      namespace NinjaTrader.Strategy
      {

      publicclass B : Strategy
      {

      protectedoverridevoid Initialize()
      {
      Add(
      "ES 06-12", PeriodType.Minute, 60);
      Add(
      "TF 06-12", PeriodType.Minute, 60);
      }

      protectedoverridevoid OnBarUpdate()
      {
      if (BarsInProgress == 0) DrawHorizontalLine("tag1",Close[0], Color.Red);

      }
      }
      }

      Comment


        #4
        Hello Aviram,
        To assist you further, can you say are you getting any specific error? If so can you upload a screenshot of it.

        To send a screenshot press Alt + PRINT SCREEN to take a screen shot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save as a jpeg file and send the file as an attachment.

        For detailed instructions please visit the following link

        How to take a screenshot on your smartphone, tablet, notebook or desktop computer


        I look forward to assisting you further.
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          Hello Joydeep

          Fixed it Thanks a lot !!!
          I did not mark the strategy as active at the controll center.

          Thanks,
          Aviram

          Originally posted by NinjaTrader_Joydeep View Post
          Hello Aviram,
          You are drawing a horizontal line at price level $500. neither ES or NQ trades at that value.

          If you replace your code with the below code can you get the horizontal line.
          Code:
          if (BarsInProgress == 0) DrawHorizontalLine("tag1",Close[0], Color.Red);


          Please let me know if I can assist you any further.

          Comment


            #6
            Hello Aviram,
            Glad to know everything is working fine at your end.

            Please let me know if I can assist you any further.
            JoydeepNinjaTrader Customer Service

            Comment


              #7
              i minute BAR wider then have to

              Dear Joydeep

              New Problem:

              ES 06-12 1 MINUTE
              Last BAR is much longer then for i Minute...

              Please see attachment

              Thanks,
              Aviram
              Attached Files

              Comment


                #8
                Hello Aviram,
                Please use the steps below to change your Time Zone and sync the PC clock, note to set the server to time.nist.gov.

                You can sync your PC clock by double clicking on the clock in the lower right corner of your desktop. Press 'Change time zone...' Set the Time zone and press 'OK'.

                Once you have done that, click on Internet Time tab set the server to time.nist.gov and then click Update. Your PC clock should now be updated.

                If you are using Windows XP then please make sure the windows cumulaive time-zone update is installed.

                Please let me know if I can assist you any further.
                JoydeepNinjaTrader Customer Service

                Comment


                  #9
                  Hello Joydeep

                  Please let me know:

                  1. How can I get the last tick price Value (with 1 Minute BAR set)
                  2. I the following code I can not start the strategy when I am adding the purpel Line.

                  Thanks,
                  Aviram



                  protectedoverridevoid Initialize()
                  {
                  Add(
                  "TF 06-12", PeriodType.Minute, 1);
                  //BarsRequired = 500;

                  CalculateOnBarClose =
                  true;
                  }

                  protectedoverridevoid OnBarUpdate()
                  {

                  if (BarsInProgress == 0)
                  {

                  double Pair_A_Value = Open[3];
                  string Pair_A_String = Pair_A_Value.ToString();
                  DrawText(
                  "tag2", Pair_A_String, 1, Close[0]+2, Color.Red);
                  double Pair_B_Value = Closes[1][0];
                  string Pair_B_String = Pair_B_Value.ToString();
                  // DrawText("tag3", Pair_B_String, 30, Close[0], Color.Black);
                  }
                  }
                  }
                  }

                  Comment


                    #10
                    Hello Aviram,
                    You are trying to tag the text on the 30th bar of the data series.
                    Code:
                    DrawText("tag3", Pair_B_String, [B][COLOR="Red"]30[/COLOR][/B], Close[0], Color.Black);
                    Please make sure you have enough bars to do it. Please refer to his post which discusses it in details


                    Please add the code
                    Code:
                    if (CurrentBars[0] < 30) return;
                    just below OnBarUpdate to resolve it.

                    Please let me know if I can assist you any further.
                    JoydeepNinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by AttiM, 02-14-2024, 05:20 PM
                    12 responses
                    211 views
                    0 likes
                    Last Post DrakeiJosh  
                    Started by cre8able, 02-11-2023, 05:43 PM
                    3 responses
                    236 views
                    0 likes
                    Last Post rhubear
                    by rhubear
                     
                    Started by frslvr, 04-11-2024, 07:26 AM
                    8 responses
                    114 views
                    1 like
                    Last Post NinjaTrader_BrandonH  
                    Started by stafe, 04-15-2024, 08:34 PM
                    10 responses
                    47 views
                    0 likes
                    Last Post stafe
                    by stafe
                     
                    Started by rocketman7, Today, 09:41 AM
                    3 responses
                    11 views
                    0 likes
                    Last Post NinjaTrader_Jesse  
                    Working...
                    X