Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help!! writing some code

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

    Help!! writing some code

    Hello everyone,
    should codify that:
    ADX indicator if the tilt increases, beginning to work. I wrote:

    # Region Calculations
    private double Value1 ()
    (
    return (ADX (30) [0] - ADX (30) [1]) / ADX (30) [1];
    )
    private double Value1B ()
    (
    return (ADX (30) [1] - ADX (30) [2]) / ADX (30) [2];
    )

    Then:

    # Region OrderRouting
    private void ManageOrder ()
    (
    if (ADX (30) [0]! = 0 & & ADX (30) [1]! = 0)

    Value1 ();
    double level 1;

    if (ADX (30) [1]! = 0 & & ADX (30) [2]! = 0)

    Value1B ();
    double level1B;


    Okay or is there a better way?
    Thank you.
    Ciao.
    Italy

    #2
    Hi Italy I´m not sure I completely follow what you mean by tilt, but the code itself looks ok, does it compile for you? Please also be aware that you would need a high enough check for bars to be present (2) at the OnBarUpdate() start section.

    Comment


      #3
      Hello Bertrand,
      Pet tilt, mean that the line indicator ADX is rising, indicating strong trend in place, and then operate only in that condition.
      I did not understand what to do when you say
      Check for bars to be present (2) at the OnBarUpdate () start section.
      Thanks for the help.
      Ciao.
      Italy

      Comment


        #4
        Then you could just work with the Rising and Falling methods directly to determine this condition -





        With my remark to the needed check for CurrentBars, I was referring to this tip's content -

        Last edited by NinjaTrader_Bertrand; 07-14-2014, 11:09 AM.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        666 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        377 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        110 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        575 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        580 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X