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

want to plot Custom Candle

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

    want to plot Custom Candle

    I want to plot candle or with different Colors which has cumulative delta vaule >+20000 or >-20000 and It should have volume >100000.

    Is this can be done ? From Where I should Start ?

    #2
    Hello svadukia,

    Thanks for the post.

    Please see the attached example script that sets up a CumulativeDelta indicator at the class level and then gets data from that indicator in OnBarUpdate. I also demonstrate how to get Volume data.

    To change the color of a bar based on a condition, you can use BarBrushes to change the color at a specified bar index.


    Below is the documentation page on the Orderflow Cumulative Delta indicator:


    Please let us know if we may be of any further assistance.
    Attached Files
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ChrisL View Post
      Hello svadukia,

      Thanks for the post.

      Please see the attached example script that sets up a CumulativeDelta indicator at the class level and then gets data from that indicator in OnBarUpdate. I also demonstrate how to get Volume data.

      To change the color of a bar based on a condition, you can use BarBrushes to change the color at a specified bar index.


      Below is the documentation page on the Orderflow Cumulative Delta indicator:


      Please let us know if we may be of any further assistance.


      protected override void OnBarUpdate()
      {
      if(CurrentBars[0] < 1) return;

      if(BarsInProgress == 0)
      {
      Print(Volume[0] +" Volume");
      Print(MyCD.DeltaClose[0] + " DClose");
      Print(MyCD.DeltaOpen[0] + " DOpen");
      Print(MyCD.DeltaHigh[0] + " DHigh");
      Print(MyCD.DeltaLow[0] + " DLow");
      }
      }

      So I need to plot my condition in this box right ??
      here it is my code

      protected override void OnBarUpdate()
      {
      if(CurrentBars[0] < 1) return;

      if(BarsInProgress == 0)
      {

      if ( (MyCD.DeltaHigh[0] - MyCDdeltaLow) >= 20000) && Volume[0] >
      100000)
      BarBrushes[0] = Brushes.Brown ;
      CandleOutlineBrushes[0] = Brushes.Brown;


      }
      }


      Is this right ??

      Comment


        #4
        Originally posted by svadukia View Post
        protected override void OnBarUpdate()
        {
        if(CurrentBars[0] < 1) return;

        if(BarsInProgress == 0)
        {
        Print(Volume[0] +" Volume");
        Print(MyCD.DeltaClose[0] + " DClose");
        Print(MyCD.DeltaOpen[0] + " DOpen");
        Print(MyCD.DeltaHigh[0] + " DHigh");
        Print(MyCD.DeltaLow[0] + " DLow");
        }
        }

        So I need to plot my condition in this box right ??
        here it is my code

        protected override void OnBarUpdate()
        {
        if(CurrentBars[0] < 1) return;

        if(BarsInProgress == 0)
        {

        if ( (MyCD.DeltaHigh[0] - MyCDdeltaLow) >= 20000) && Volume[0] >
        100000)
        BarBrushes[0] = Brushes.Brown ;
        CandleOutlineBrushes[0] = Brushes.Brown;


        }
        }


        Is this right ??
        Tried that code but getting an error as shown in the attached picture in another line of code...
        Attached Files

        Comment


          #5
          Hello svadukia,

          Thanks for the reply.

          Did you define MyCD like so? :

          Code:
          public class Test : Indicator
          	{
          		
          		private OrderFlowCumulativeDelta MyCD;
                  ...
          I look forward to your reply.
          Chris L.NinjaTrader Customer Service

          Comment


            #6
            Originally posted by NinjaTrader_ChrisL View Post
            Hello svadukia,

            Thanks for the reply.

            Did you define MyCD like so? :

            Code:
            public class Test : Indicator
            	{
            		
            		private OrderFlowCumulativeDelta MyCD;
                    ...
            I look forward to your reply.
            Yes Define same that way.. all things are same as u gave in zip file...

            Comment


              #7
              Hello svadukia,

              Thanks for the reply.

              The release notes here say that the signature for DeltaType was changed in revision 13.1.



              Please make sure you are on revision 8.0.13.1 by going to Help> About.

              If you are not, please update your installation with these steps:
              1. First, copy your license key from NinjaTrader under Help> License Key then exit NinjaTrader
              2. Click on the link: http://ninjatrader.com/PlatformDirect
              3. Enter your license key and press Submit
              4. Select 'NinjaTrader 8'
              5. Select 'Download'
              6. Critical: Before running the installer, ensure NinjaTrader is closed.
              7. Run the installer.


              I look forward to hearing of your results.
              Chris L.NinjaTrader Customer Service

              Comment


                #8
                Originally posted by NinjaTrader_ChrisL View Post
                Hello svadukia,

                Thanks for the reply.

                The release notes here say that the signature for DeltaType was changed in revision 13.1.



                Please make sure you are on revision 8.0.13.1 by going to Help> About.

                If you are not, please update your installation with these steps:
                1. First, copy your license key from NinjaTrader under Help> License Key then exit NinjaTrader
                2. Click on the link: http://ninjatrader.com/PlatformDirect
                3. Enter your license key and press Submit
                4. Select 'NinjaTrader 8'
                5. Select 'Download'
                6. Critical: Before running the installer, ensure NinjaTrader is closed.
                7. Run the installer.


                I look forward to hearing of your results.
                It's Done Thanks...

                I have one another problem...want to plot only those volume which is Greater then Previous Volume


                SO I did this...

                protected override void OnBarUpdate()
                {

                if (Volume[0] >= Volume[1])
                {
                Value[0] = Volume[0] ;

                }
                else
                {
                Value.Reset();
                }
                }

                But it is plotting nothing

                Comment


                  #9
                  Hello svadukia,

                  Thanks for the reply.

                  I am able to plot this in my attempt. Please see the attached example and let me know if you do not see the plot.
                  Attached Files
                  Chris L.NinjaTrader Customer Service

                  Comment


                    #10
                    Originally posted by NinjaTrader_ChrisL View Post
                    Hello svadukia,

                    Thanks for the reply.

                    I am able to plot this in my attempt. Please see the attached example and let me know if you do not see the plot.
                    It's Done though had to add,

                    If ( CurrentBar < 1) return;


                    otherwise, it was not plotting.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by CortexZenUSA, Today, 12:53 AM
                    0 responses
                    1 view
                    0 likes
                    Last Post CortexZenUSA  
                    Started by CortexZenUSA, Today, 12:46 AM
                    0 responses
                    1 view
                    0 likes
                    Last Post CortexZenUSA  
                    Started by usazencortex, Today, 12:43 AM
                    0 responses
                    5 views
                    0 likes
                    Last Post usazencortex  
                    Started by sidlercom80, 10-28-2023, 08:49 AM
                    168 responses
                    2,265 views
                    0 likes
                    Last Post sidlercom80  
                    Started by Barry Milan, Yesterday, 10:35 PM
                    3 responses
                    12 views
                    0 likes
                    Last Post NinjaTrader_Manfred  
                    Working...
                    X