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

Question: Newbie here on NinjaTrader 8

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

    Question: Newbie here on NinjaTrader 8

    Hello Good People,

    Please help me to not necessarily develop my strategy, but to realize my strategy. I have an idea in mind--a backtested strategy-- though not prepared to disclose fully. However some of its parameters / variables go like this and as follows.

    In speculating with currency futures, and the broker is IB, how does one pull the following on NT 8 -- current values and previous hour's values? Please correct me if I am wrong, Very new to NT, I am only working with 8 and not 7 but I am not seeing the same option/window in 8 that I saw in 7.

    Generally the idea goes like this. Basically at time equals t=0 (now), I would like to pull the previous hour's open, high, low, close. Then do calculation against the current bid/ask values and then open/close a position by going long/short. That's generally the gist of the strategy! [And of course, the current hour's open is the previous hour's close].

    And how do you make NT8 pull those values in variable form every hour--instead of every second via tick by tick. To clarify, let's say I only intend to trade every 60 minutes. Whether the market hits the PNL drastically, that's a different matter. However my core philosophy is basically to wait and not chase every pip and tick like HFT people. Instead my principle is to carry a predetermined amount of loss until the market moves in the speculated position and go from there.

    To to summarize for starters, how do you make NT8 do the following, preferably without quite yet going into the NinjaScript.
    Pull current bid/ask in variable form
    Pull previous hour's open, high, low, close
    Make it do this every 60 minutes. Period. Please help!


    Thank you!
    Robel

    #2
    Hello robel,

    Thanks for your post and welcome to the NinjaTrader forums!

    To access current values, you would need to run your strategy with the calculation mode of Calculate.OnPriceChange or Calculate.OnEachTick as these will permit you access to the currently forming bar and thus the current bid/ask, open high, low of the currently forming bar. Reference: https://ninjatrader.com/support/help...?calculate.htm

    Bar data is accessed by using a "bars ago" index. For example, Low[0] would be the current low of the currently forming bar (which can change) and Low[1] is the low of the previous bar, Low[2] would be the bar before that. The data of the previous bars does not change. Reference: https://ninjatrader.com/support/help...orrect_bar.htm

    Depending on what calculations you need to do, you may be able to use the Strategy Builder to create the strategy. The Strategy Builder is used to generate NinjaScript based strategies for automated systems trading without the need to learn Ninjascript coding. The strategy builder does build code for you which you can review if you wish or not at all. Here is a link to the strategy builder help guide: https://ninjatrader.com/support/help...gy_builder.htm

    If you would like to attend free, live webinar training on the strategy builder, here is a link to all of our training: https://ninjatrader.com/PlatformTraining The strategy builder training alternates with the Ninjascript editor on Thursdays (so one or the other each week at the same time slot). Alternately, or in addition, here is a link to a previously recorded webinar which you can review at your convenience: https://www.youtube.com/watch?v=HCyt...ZmVnauWXkWe0Nf

    Alternately, if you would like your strategy created for you, we can provide links to 3rd party programmers that are well versed in Ninjascript strategies and can provide that service.

    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by DJ888, 04-16-2024, 06:09 PM
    6 responses
    18 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by Jon17, Today, 04:33 PM
    0 responses
    1 view
    0 likes
    Last Post Jon17
    by Jon17
     
    Started by Javierw.ok, Today, 04:12 PM
    0 responses
    6 views
    0 likes
    Last Post Javierw.ok  
    Started by timmbbo, Today, 08:59 AM
    2 responses
    10 views
    0 likes
    Last Post bltdavid  
    Started by alifarahani, Today, 09:40 AM
    6 responses
    41 views
    0 likes
    Last Post alifarahani  
    Working...
    X