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

Alert Problem

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

    Alert Problem

    Hey all, i have a little problem with alert "issuance"

    Im trying to get an alert triggered on "Trend Change" using (Renko Hybrid Bar Type)

    So what i did is i got the indicator calculating on bar Close= false
    and
    ( Close[2] > Open[2] && Close[1] < Open[1] )
    {
    AlertXXXX
    }

    But the alert doesn't get triggered until after a 3rd bar has closed after the condition was met, which is unnecessary.

    if i do ( Close[1] > Open[1] && Close[0] < Open[0] ) it gets triggered despite the current bar hasn't closed yet, so it can reverse and that's not good :P

    How can i get the alert triggered immediately after the "change trend" bar close ??



    Click image for larger version

Name:	2014-12-16_135907.jpg
Views:	1
Size:	76.9 KB
ID:	902263
    Thank you guys.
    Last edited by kabott; 12-16-2014, 11:40 AM.

    #2
    Hello Kabott,

    Thank you for your post.

    I don't expect checking the came value for less than or greater than to work at all.
    Close[1] < Close[1]
    Close[0] < Close[1]

    Are you looking to check if the Close is greater than the Open in this case?

    If it is for Open then you want to check for FirstTickOfBar so that when the first down bar closes it will check this and allow you check the last two bars correctly.

    if(Close[2] >= Open[2] && Close[1] < Open[1] && FirstTickOfBar)
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Yes cal, i made a mistake writing the conditions here, but its alright on the ninjascript, i corrected that , anyways i think i was missing "FirstTickOfBar" thank you!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by fx.practic, 10-15-2013, 12:53 AM
      5 responses
      5,403 views
      0 likes
      Last Post Bidder
      by Bidder
       
      Started by Shai Samuel, 07-02-2022, 02:46 PM
      4 responses
      94 views
      0 likes
      Last Post Bidder
      by Bidder
       
      Started by DJ888, Yesterday, 10:57 PM
      0 responses
      6 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by MacDad, 02-25-2024, 11:48 PM
      7 responses
      158 views
      0 likes
      Last Post loganjarosz123  
      Started by Belfortbucks, Yesterday, 09:29 PM
      0 responses
      8 views
      0 likes
      Last Post Belfortbucks  
      Working...
      X