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

Cumulative delta indicator tos to ninjatrader

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

    Cumulative delta indicator tos to ninjatrader


    HELLO FRIENDS WHO CAN HELP ME PASS THIS SCRIP FROM TOS TO NINJATRADER
    declare lower;

    input length = 10;
    def O = open;
    def H = high;
    def C = close;
    def L = low;
    def V = volume;
    def Buying = V * (C - L) / (H - L);
    def Selling = V * (H - C) / (H - L);
    def Delt = buying - selling;
    plot Delta = Delt;
    Delta.AssignValueColor(if Delta > 0 then Color.GREEN else Color.RED);
    Delta.SetPaintingStrategy(PaintingStrategy.HISTOGR AM);
    Delta.hide();
    plot zero = 0;
    zero.setDefaultColor(Color.BLUE);
    plot CumulativeVolumeDelta = sum(Delta,length);
    CumulativeVolumeDelta.AssignValueColor(if CumulativeVolumeDelta > 0 then Color.GREEN else Color.RED);
    CumulativeVolumeDelta.SetPaintingStrategy(Painting Strategy.HISTOGRAM);

    #2
    Hello fitmar2525,

    Welcome to the NinjaTrader forums!

    This thread will remain open for any community members that would like to code this for you as a convenience to you.

    You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like our NinjaTrader Ecosystem team follow up with you with a list of affiliate consultants who would be happy to create this script or any others at your request or provide one on one educational services.


    We are happy to answer any questions you may have about NinjaScript if you decide to code this yourself.

    Below I am providing a link to a forum post with helpful information about getting started with NinjaScript and C#.


    As well as a link to the help guide on the Order Flow Cumulative Delta premium indicator.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3

      How can I apply the period to this indicator that I am creating?


      protected override void OnBarUpdate()
      {
      //Value[0] = CurrentBar == 0 ? 0 : Input[0] - Input[Math.Min(CurrentBar, Perido)];

      double O = Open[0];
      double H = High[0];
      double C = Close[0];
      double L = Low[0];
      double V = Volume[0];
      double Buying = V * (C - L) / (H - L);
      double Selling = V * (H - C) / (H - L);
      double Delt = Buying - Selling;


      Value[0] = Delt;

      if (Delt > 0) {
      PlotBrushes[0][0] = BrushUpEnd;
      } else {
      PlotBrushes[0][0] = BrushDownBegin;
      }

      Comment


        #4
        Hello fitmar2525,

        The SMA included with NinjaTrader is a great example of using a period.

        The public input is declared on lines 84 to 87, the default value for this is set on line 46, and the value used for calculations and barsAgo values in the logic on lines 65 through 79.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by techgetgame, Yesterday, 11:42 PM
        0 responses
        8 views
        0 likes
        Last Post techgetgame  
        Started by sephichapdson, Yesterday, 11:36 PM
        0 responses
        2 views
        0 likes
        Last Post sephichapdson  
        Started by bortz, 11-06-2023, 08:04 AM
        47 responses
        1,613 views
        0 likes
        Last Post aligator  
        Started by jaybedreamin, Yesterday, 05:56 PM
        0 responses
        10 views
        0 likes
        Last Post jaybedreamin  
        Started by DJ888, 04-16-2024, 06:09 PM
        6 responses
        20 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Working...
        X