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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        64 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        35 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        59 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        62 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        51 views
        0 likes
        Last Post CarlTrading  
        Working...
        X