• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problem Launching Own Indicator

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

    Problem Launching Own Indicator

    Hi, I am new to NT7, currently I am trying and practising writing myself some simple indicators script as testing. However, I found some issue that troubling me badly, when I launch my indicator, the real time data did not update itself, when my realtime data did update itself, the indicator is not working, may I know did I miss anything in my script? I just using Wizard to create my indicator and make some simple equation and drawing some shape on my chart, but I cannot test it for work. Sorry for newbie here, but I cannot find any resources regarding my problem hence I need to request help from here. Thanks in advance.
    My data service provider is CQG

    #2
    Hello,

    Thank you for the questions I will be happy to help.

    It is hard to say exactly why the indicator is not working without seeing the code you are using. If you would like you can post the code you are using in the forum, support staff along with users are then able to assist you in problems you may be having.

    A couple of helpful notes on how to debug what may be happening:

    When you do not see the indicator plotting on the chart when you expect it to a good first step is to check the output log.
    You can open the output window by clicking Tools -> Output window

    this window is used solely for NinjaScript so this is a great window to have open 100% of the time you are developing a NinjaScript file.

    In this case if you open the output window and then apply the indicator to a chart, do you see any errors listed?

    Additionally we have a excellent Tips section for NinjaScript:
    http://www.ninjatrader.com/support/f...splay.php?f=31

    Also a Reference Samples section:
    http://www.ninjatrader.com/support/f...splay.php?f=30


    If you can provide the code I would be happy to look at it and see where the holdup is.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Ok thanks, the problem solved by defining if (CurrentBar < 2).
      Another problem and question I am having here, how can i define and made use of my own variable?
      Can you show me a syntax of command for NT?
      For eg, I need to define "A" as "Volume[0] / (High[0]-Low[0])
      Then I wish to make a comparison of value A through SMA[A] (my customised variable)
      If A[0] > SMA[A] + 500, then continue with plotting or alert command, may I know how can I do so in NT? Thanks if any help provided, because I am newbie here, looking forward your reply, thanks!

      Comment


        #4
        Hello,
        Thank you for the questions.

        For defining variables, NinjaScript follows C# guidelines so some examples of some variables are below:

        Code:
        double A = Close[0];
        bool trueFalse = true;
        int integerVal = 100;
        decimal dec = 100.05M;
        string str = "Hello World";
        So each variable must have a type followed by a name followed by an assignment.

        Now if you wanted to do some calculations using a variable you could do something like this:

        Code:
        double A = Volume[0] / (High[0]-Low[0]);
        if this was put in OnBarUpdate this would calculate the double A every bar for use.


        For your second question I would like to clariify, are you trying to use the value of the double A for the bars ago in this equation?
        A[0] > SMA[A]

        If so the SMA would only be able to accept a period of a integer value or a whole number.

        If you are trying to use the SMA to average the results of the double A you would need to change A from a double to a DataSeries so that it could be used with the SMA.
        Here is more information on DataSeries http://www.ninjatrader.com/support/h...ries_class.htm

        Please let me know if I may be of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Ok quite a shock and surprise when seeing your reply Jesse! Really thanks very much for providing such good support services for NinjaTrader user, however, I already finished develop my indicator by referring DataSeries guide 2 days ago, anyway really thanks very much for your help, appreciated and will support NinjaTrader!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by bosajin, Yesterday, 06:27 PM
          1 response
          7 views
          0 likes
          Last Post NinjaTrader_Jim  
          Started by stefanrvc, Today, 04:59 AM
          1 response
          14 views
          0 likes
          Last Post NinjaTrader_Marco  
          Started by 7robert, Yesterday, 08:30 PM
          2 responses
          16 views
          0 likes
          Last Post NinjaTrader_Marco  
          Started by pjsmith, Today, 01:13 AM
          1 response
          16 views
          0 likes
          Last Post NinjaTrader_ChrisSch  
          Started by yukashg, Yesterday, 09:56 PM
          1 response
          16 views
          0 likes
          Last Post NinjaTrader_ChrisSch  
          Working...
          X