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

Price Alert as price closes XXpips above a level

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

    Price Alert as price closes XXpips above a level

    Hi,

    I hope someone can help with this basic coding. I'm not sure how to work with numbers in Ninjascript.

    I want the price alert indicator to be plotted on the chart at 3 pips above a price level once price closes 15 pips greater than that price level. This is for forex.

    The levels are 00 25 50 and 75 or x.xx00 x.xx25 x.xx50 x.xx75

    The USDJPY would be xx.00 xx.25 xx.50 xx.75

    Example EURUSD, if price penetrates 1.3675 by 15 pips (1.3690) the price alert indicator is plotted at 1.3678

    Also for the reverse of that, so if price penetrates 15 pips lower than a level the price alert indicator is plotted 3 pips below that level.

    Also if price doesn't pull back and touch the price alert indicator but instead goes beyond the next level then it automatically moves it up to the next level. So basically it follows price as it continues higher or lower and not having a price alert indicator plotted at every level, just the one. I've attached an image for clarity.

    Thanks
    Attached Files
    Last edited by Sakkers; 10-18-2013, 05:04 AM.

    #2
    Hi Sakkers,

    Thank you for your post.

    It looks like you got the logic down.

    With the numbers, what exact problem are you having?
    Distinguishing between the different tick sizes?
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Cal, thanks for the reply.

      How do I define those price levels as Ninjascript?
      for example this code below works but is specific to the exact price, where as I want to only specify the levels x.xx00 x.xx25 x.xx50 x.xx75

      And how do i plot the Price Alert Indicator, i tried the Condition Builder but it is not available in the indicator list??

      if ((Close[0] > 0.9600 + 30 * TickSize) && Close[0] < 0.9625)
      {
      Plot Price Alert indicator - 16 * TickSize
      }

      if ((Close[0] > 0.9625 + 30 * TickSize) && Close[0] < 0.9650)
      {
      Plot Price Alert indicator - 16 * TickSize
      }

      if((Close[0] > 0.9650 + 30 * TickSize) && Close[0] < 0.9675)
      {
      Plot Price Alert indicator - 16 * TickSize
      }

      if((Close[0] > 0.9675 + 30 * TickSize) && Close[0] < 0.9700)
      {
      Plot Price Alert indicator - 16 * TickSize
      }

      Comment


        #4
        Sakkers,

        Try using this to get the x.xx25 increment value of what you are looking for.

        Math.Floor(N/.0025) * .0025

        N will be the value you want to calculate the increment of.

        Let me know if this is the answer you are looking for.
        Cal H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by SantoshXX, Today, 03:09 AM
        0 responses
        12 views
        0 likes
        Last Post SantoshXX  
        Started by DanielTynera, Today, 01:14 AM
        0 responses
        2 views
        0 likes
        Last Post DanielTynera  
        Started by yertle, 04-18-2024, 08:38 AM
        9 responses
        42 views
        0 likes
        Last Post yertle
        by yertle
         
        Started by techgetgame, Yesterday, 11:42 PM
        0 responses
        14 views
        0 likes
        Last Post techgetgame  
        Started by sephichapdson, Yesterday, 11:36 PM
        0 responses
        2 views
        0 likes
        Last Post sephichapdson  
        Working...
        X