• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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 ksarin, Today, 12:39 PM
    3 responses
    11 views
    0 likes
    Last Post NinjaTrader_PatrickG  
    Started by ttodua, Today, 12:03 PM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by tomtr27, Today, 11:35 AM
    1 response
    9 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by Uregon, Today, 07:30 AM
    2 responses
    13 views
    0 likes
    Last Post bltdavid  
    Started by Induna, 02-20-2020, 05:38 AM
    4 responses
    26 views
    0 likes
    Last Post NinjaTrader_Kate  
    Working...
    X