Announcement

Collapse
No announcement yet.

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#.
    https://ninjatrader.com/support/foru...040#post786040

    As well as a link to the help guide on the Order Flow Cumulative Delta premium indicator.
    https://ninjatrader.com/support/help...ive_delta2.htm
    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 imalil, Today, 06:07 PM
        0 responses
        1 view
        0 likes
        Last Post imalil
        by imalil
         
        Started by gchan, Today, 05:48 PM
        0 responses
        3 views
        0 likes
        Last Post gchan
        by gchan
         
        Started by herbnderby, Today, 02:29 PM
        5 responses
        13 views
        0 likes
        Last Post NinjaTrader_Kate  
        Started by Neo2020, Today, 01:51 PM
        3 responses
        27 views
        0 likes
        Last Post NinjaTrader_Melissa  
        Started by RFrosty, Today, 01:46 PM
        0 responses
        18 views
        0 likes
        Last Post RFrosty
        by RFrosty
         
        Working...
        X