NexusFi: Find Your Edge


Home Menu

 





how to run ninjascript automatically at specific time


Discussion in NinjaTrader

Updated
    1. trending_up 1,728 views
    2. thumb_up 5 thanks given
    3. group 3 followers
    1. forum 4 posts
    2. attach_file 0 attachments




 
Search this Thread

how to run ninjascript automatically at specific time

  #1 (permalink)
 Clydexi 
Dallas
 
Experience: Beginner
Platform: NinjaTrader
Trading: Emini ES
Posts: 9 since Jan 2016
Thanks Given: 1
Thanks Received: 1

I wrote a indicator script which pulls data from other resources. It requests data when the indicator loads. I wonder how to let the script run every 1 hour or run at specific time automatically instead of loading the indicator manually.

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NexusFi Journal Challenge - May 2024
Feedback and Announcements
REcommedations for programming help
Sierra Chart
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Quant vue
Trading Reviews and Vendors
Cheap historycal L1 data for stocks
Stocks and ETFs
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
What is Markets Chat (markets.chat) real-time trading ro …
76 thanks
Spoo-nalysis ES e-mini futures S&P 500
55 thanks
Just another trading journal: PA, Wyckoff & Trends
37 thanks
Bigger Wins or Fewer Losses?
24 thanks
The Program
17 thanks
  #2 (permalink)
 
rleplae's Avatar
 rleplae 
Gits (Hooglede) Belgium
Legendary Market Wizard
 
Experience: Master
Platform: NinjaTrader, Proprietary,
Broker: Ninjabrokerage/IQfeed + Synthetic datafeed
Trading: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
Posts: 3,003 since Sep 2013
Thanks Given: 2,442
Thanks Received: 5,863

You can do the same in the OnBarUpdate() method, add some extra filter code where you sotre the hour and do only the logic if the time since last Bar is more than one hour. It is not exact, because if there is no bar, it code will not trigger, but it might be the easiest way to quickly get to result.

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #3 (permalink)
 Clydexi 
Dallas
 
Experience: Beginner
Platform: NinjaTrader
Trading: Emini ES
Posts: 9 since Jan 2016
Thanks Given: 1
Thanks Received: 1



rleplae View Post
You can do the same in the OnBarUpdate() method, add some extra filter code where you sotre the hour and do only the logic if the time since last Bar is more than one hour. It is not exact, because if there is no bar, it code will not trigger, but it might be the easiest way to quickly get to result.

Thanks! Could you refer any indicators in futures.io which use the OnBarUpdate() method?

Started this thread Reply With Quote
Thanked by:
  #4 (permalink)
 Clydexi 
Dallas
 
Experience: Beginner
Platform: NinjaTrader
Trading: Emini ES
Posts: 9 since Jan 2016
Thanks Given: 1
Thanks Received: 1


NTDeveloper View Post
Or you can use the timers.

Could you give any reference to it as I haven't used it before? thanks

Started this thread Reply With Quote
  #5 (permalink)
 
rleplae's Avatar
 rleplae 
Gits (Hooglede) Belgium
Legendary Market Wizard
 
Experience: Master
Platform: NinjaTrader, Proprietary,
Broker: Ninjabrokerage/IQfeed + Synthetic datafeed
Trading: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
Posts: 3,003 since Sep 2013
Thanks Given: 2,442
Thanks Received: 5,863


Clydexi View Post
Thanks! Could you refer any indicators in futures.io which use the OnBarUpdate() method?

Most of the indicators do
or just go to documents\ninjatrader 7\bin\custom\indicator

open the first file @ADL.cs

you wil see the OnBarUpdate

 
Code
     protected override void OnBarUpdate()
        {
            AD.Set((CurrentBar == 0 ? 0 : AD[1]) + (High[0] != Low[0] ? (((Close[0] - Low[0]) - (High[0] - Close[0])) / (High[0] - Low[0])) * Volume[0] : 0));
        }
In your own indicator, you can have this function also
it will be called every time the bar gets updated

You then call play with the time, so that your logic only gets triggered when you want

or you can play with the timers as mentioned also

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote




Last Updated on March 29, 2016


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts