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 WHICKED, Today, 12:45 PM
        2 responses
        19 views
        0 likes
        Last Post WHICKED
        by WHICKED
         
        Started by GussJ, 03-04-2020, 03:11 PM
        15 responses
        3,276 views
        0 likes
        Last Post xiinteractive  
        Started by Tim-c, Today, 02:10 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by Taddypole, Today, 02:47 PM
        0 responses
        5 views
        0 likes
        Last Post Taddypole  
        Started by chbruno, 04-24-2024, 04:10 PM
        4 responses
        51 views
        0 likes
        Last Post chbruno
        by chbruno
         
        Working...
        X