Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

BarTimer - Display in custom Indicator

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

    BarTimer - Display in custom Indicator

    Hi,

    I have a custom indicator that i'm creating. I would like to add the BarTimer indicator within my code. How can I add this? I couldn't find any example of how to add this and then also allow the user to use a check mark to disable or enable it in the properties?

    Please let me know.

    Thanks,

    #2
    Hello priceisking,

    You would need to write the same logic in the Bar Timer script into the logic of your script.

    The closest example of copying logic from one script to another is the NinjaScript Editor 401 video.


    You can create inputs for the user to change. A bool would be the checkbox and would have a true or false value.

    Below is a public link to a 3rd party educational site on bool.
    Test the bool type, which holds true or false. A bool occupies 1 byte of memory.


    And a public link to the reference sample on exposing variables.

    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Ok will check it out.

      Would it be possible to create something like this:

      private BarTimer myBarTimer;

      ..
      .
      and then use it in the code something like this:

      this.myBarTimer.show();

      ?

      Instead of coding entire thing that's already done. Was wondering if easy way to do that.

      Comment


        #4
        Hello priceisking,

        The BarTimer indicator does not have a public plot that gets returned.

        You could modify a copy of this script and make a public variable that calls Update() and returns either the barTimeLeft or returns the string that is drawn in the Draw.TextFixed that you can call from another script.

        Below is a public link to a reference sample that demonstrates exposing variables.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by rbeckmann05, Yesterday, 06:48 PM
        1 response
        12 views
        0 likes
        Last Post bltdavid  
        Started by llanqui, Today, 03:53 AM
        0 responses
        6 views
        0 likes
        Last Post llanqui
        by llanqui
         
        Started by burtoninlondon, Today, 12:38 AM
        0 responses
        10 views
        0 likes
        Last Post burtoninlondon  
        Started by AaronKoRn, Yesterday, 09:49 PM
        0 responses
        15 views
        0 likes
        Last Post AaronKoRn  
        Started by carnitron, Yesterday, 08:42 PM
        0 responses
        11 views
        0 likes
        Last Post carnitron  
        Working...
        X