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

mathamatic coding of candle data

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

    mathamatic coding of candle data

    Currently i am only calling on the bottom wick is longer than the top wick in my second condition

    I want to code my condition to the bottom wick is 2x greater or more than the top wick

    can someone point me in the right direction


    Cheers.

    if((Close[0] > Open[0]) // CURRENT CANDLE IS GREEN

    &&(Open[0] - Low[0] > High[0] - Close[0]) //BOTTOM WICK IS LONGER THAN TOP WICK​

    #2
    Hello Christopher Leggit,

    Thank you for your post.

    If you are defining Open[0]-Low[0] as the bottom, and High[0]-Close[0] as the top wick, to check if the Bottom is at least 2x greater than the top you can do the following:

    if ( (Open[0] - Low[0]) * 2 > High[0] - Close[0]) )
    //do something

    Please let us know if you have any further questions.
    Gaby V.NinjaTrader Customer Service

    Comment


      #3
      I had tried *2 in-between but not defining the bottom wick with it's own set of brackets is where i was going wrong.

      thank you Gabby.

      kind regards

      Christopher

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by cshox, 12-12-2023, 06:39 PM
      5 responses
      228 views
      0 likes
      Last Post JuanErnesto  
      Started by abandonedBaby, 06-12-2024, 12:08 PM
      5 responses
      22 views
      0 likes
      Last Post abandonedBaby  
      Started by AaronKoRn, Today, 08:44 PM
      0 responses
      7 views
      0 likes
      Last Post AaronKoRn  
      Started by trader252, Today, 08:32 PM
      0 responses
      6 views
      0 likes
      Last Post trader252  
      Started by Randy Hotcakes, Today, 08:10 PM
      0 responses
      8 views
      0 likes
      Last Post Randy Hotcakes  
      Working...
      X