Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

HELP: Newbie to code - need some direction :)

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

    HELP: Newbie to code - need some direction :)

    If anyone can point me in the direction of how to setup a indicator, that would be great! I am guessing the programming is in C#?

    Also, I know there are some classes already built out, maybe someone can point me in the right direction...

    The indicator I want to build is illustrated in this image:


    Basically the rules are this:
    1. Requires 2 candles to paint in the same direction
    2. Candles must be filled 75% or more from wick to wick (In respective direction)
    3. Candle #3 must paint in the same direction to change color (Blue or Pink)
    4. Volume is greater than 4000 (on painting indicator)
    5. If rules 1-4 are met, the candle will paint "Pink"(going short) or "Dodger Blue" (going long) & a BEEP will sound once


    Hopefully that gives enough info. Thanks for any help!
    Last edited by WatanabeStevenC; 10-16-2014, 07:50 PM.

    #2
    Hello Steven,

    Thank you for your note.

    Could you please elaborate more on this line here -

    2. Candles must be filled 75% or more from wick to wick (In respective direction)

    What exactly does this mean in regards to the bars?
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the reply! Hopefully this video will clarify what I mean:
      Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.

      Comment


        #4
        Steven,

        Thank you for the explanation.

        Please note that we do not offer custom development of indicators and strategies.

        However, I was able to put something together that should give you what you are looking for.

        You will need to download and import this into NinjaTrader

        To Import

        * Download the indicator to your desktop, keep them in the compressed .zip file.
        * From the Control Center window select the menu File> Utilities> Import NinjaScript
        * Select the downloaded .zip file
        * NinjaTrader will then confirm if the import has been successful.


        Critical - Specifically for some indicators, it will prompt that you are running newer versions of @SMA, @EMA, etc. and ask if you want to replace, press 'No'
        Attached Files
        Last edited by NinjaTrader_CalH; 10-21-2014, 07:52 AM.
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          disregard (deleted content)
          Last edited by WatanabeStevenC; 10-17-2014, 06:52 PM.

          Comment


            #6
            Oh! I just noticed a discrepency... Here is a video to clarify:
            Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.


            Thanks again soooooo much for your help!

            Comment


              #7
              Steven,

              You will need to set the CalculateOnBarClose property to False.

              This will have the indicator update on the bar being built.
              Cal H.NinjaTrader Customer Service

              Comment


                #8
                so this:
                indicator.CalculateOnBarClose = CalculateOnBarClose;

                should be this?
                indicator.CalculateOnBarClose = False;


                ???

                It doesn't seem to work for me
                Last edited by WatanabeStevenC; 10-18-2014, 07:21 PM.

                Comment


                  #9
                  Steven,

                  Two ways to do this.

                  First is you can add CalculateOnBarClose = false; to the Initialize() method

                  Second is you can select this property when you add the indicator the chart, Right click in the chart -> Indicators... -> Change the COBC property to false
                  Cal H.NinjaTrader Customer Service

                  Comment


                    #10
                    Thanks so much for the help! There is an issue with the sound though... take a look:
                    Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.


                    I also noticed that when the market goes the opposite direction, the color is still painted. Can we make it so the candle changes back to red/green (the normal chart colors) if the market goes the opposite direction?
                    Last edited by WatanabeStevenC; 10-18-2014, 08:34 PM.

                    Comment


                      #11
                      I was able to get the name of the indicator to chang, but i'm still having the same issues as mentioned in the previous post

                      Comment


                        #12
                        NinjaTrader_Cal - Do you have any other suggestions.

                        Comment


                          #13
                          Steven,

                          I am working on this.

                          For the sound, do you only want the sound to only play once?

                          What if the bar pulls back but then crosses again? Do you want the sound to play again?

                          If you want to rename the indicator you can right click in the editor and give it a new name.
                          Tools -> Edit NinjaScript -> Indicator -> Select the current version -> Ok -> Right click in the editor and Save As... -> Give the file a new name to use.
                          Cal H.NinjaTrader Customer Service

                          Comment


                            #14
                            Thanks so much! I only would like the sound to play once per candle. If it pulls back and crosses again, do not play the sound again.

                            Comment


                              #15
                              Hello Steven,

                              I have update the indicator.

                              This should get you a good starting base moving forward for anything else you may need to add to this.
                              Attached Files
                              Cal H.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by geddyisodin, Yesterday, 05:20 AM
                              7 responses
                              45 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Started by gbourque, Today, 06:39 AM
                              2 responses
                              5 views
                              0 likes
                              Last Post gbourque  
                              Started by cre8able, Yesterday, 07:24 PM
                              1 response
                              13 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Started by cocoescala, 10-12-2018, 11:02 PM
                              6 responses
                              939 views
                              0 likes
                              Last Post Jquiroz1975  
                              Started by cmtjoancolmenero, Yesterday, 03:58 PM
                              1 response
                              17 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Working...
                              X