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

signal end of the day without waiting the open of the next day

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

    signal end of the day without waiting the open of the next day

    Hi

    i wrote a script to detect the divergence between the price and the Rsi. Each time there is a divergence (bullish or bearish), the script send me an email, to alert me.

    i tried to run this script on daily on the 500 equities of the S&P to get after the close an email with all the equities where there is a divergence.

    My problem is that i wrote the script CalculateOnBarClose=true, and the email is sent after the open of the next day, not on the close of [0].

    in fact, i want to receive the emails after the US session like that i have all the morning (French time) to verify the signals and to select the best oppotunities.

    I tried with CalculateOnBarClose=false but i receive a thousand emails... is there a solution to get the signal without waiting the open on the next day bar ?

    Thx

    #2
    Hello Thomas79,

    Thank you for your post.

    Since, the Close of a bar is not set until the next bar is created, which is the open of the next day.

    What you want to do is then create a method that is checking the current time of the PC clock (DateTime.Now) to a set time, say after the close, and then sending you that email you want.

    I have attached an example of how this is done.

    Let me know if I can be of further assistance.
    Attached Files
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Hi Cal

      thx for your answer but when i download i have a attachment.php on my download directory
      what i have to suppose to do with it ? make a import Ninja script ?

      Comment


        #4
        Thomas79,

        Try this .Zip instead and import it into NinjaTrader


        * ownload the indicator to your desktop, keep them in the compressed .zip file.
        * From the Control Center window select the menu File> Utilities> Import NinjaScript
        * Select the downloaded .zip file
        * NinjaTrader will then confirm if the import has been successful.


        Critical - Specifically for some indicators, it will prompt that you are running newer versions of @SMA, @EMA, etc. and ask if you want to replace, press 'No'
        Attached Files
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          ok thx

          can i use this on a strategy script instead of an indicator script ?

          Comment


            #6
            Thomas79,

            Yes, exact same setup would apply for a strategy
            Cal H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Belfortbucks, Today, 09:29 PM
            0 responses
            6 views
            0 likes
            Last Post Belfortbucks  
            Started by zstheorist, Today, 07:52 PM
            0 responses
            7 views
            0 likes
            Last Post zstheorist  
            Started by pmachiraju, 11-01-2023, 04:46 AM
            8 responses
            151 views
            0 likes
            Last Post rehmans
            by rehmans
             
            Started by mattbsea, Today, 05:44 PM
            0 responses
            6 views
            0 likes
            Last Post mattbsea  
            Started by RideMe, 04-07-2024, 04:54 PM
            6 responses
            33 views
            0 likes
            Last Post RideMe
            by RideMe
             
            Working...
            X