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 charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        56 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        143 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        160 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        96 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        276 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X