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

New to NinjaScript, need help on how to start...

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

    New to NinjaScript, need help on how to start...

    Hello everyone and thanks in advance

    I am about to finish a quick course on C# (have some prior background in Java), and I want to try and develop a script in NinjaTrader.

    What I'm basically trying to achieve for a start is getting the current Bid and Ask values, let's say of Apple stock. I saw there's a GetCurrentBid() function in the documentation, but I don't even know where to put it.

    Is there a template somewhere I can follow? A tutorial for beginners? In NinjaScript Explorer there are different categories (AddOns, BarsTypes, etc..) - I tried looking at them but can't figure what each method does in there or where to even find that information.

    Any assistance will be more than welcome!

    Kindest regards

    #2
    Hello as1988,

    Welcome to the NinjaTrader forums!

    Below is a link to a forum post with helpful resources on getting started with NinjaScript and C#.
    https://ninjatrader.com/support/foru...pts#post786040

    GetCurrentAsk() / GetCurrentBid() can be used in OnBarUpdate(). These return the current ask or bid at the time the method is called.

    Try adding to OnBarUpdate():

    Print(Time[0] + " | " + GetCurrentAsk().ToString());

    And the view the output in the NinjaScript Output window.
    https://ninjatrader.com/support/foru...121#post791121


    If you want all of the ask and bid prices as they change, this is available in OnMarketData().
    https://ninjatrader.com/support/help...marketdata.htm

    Below is a link to an example.
    http://ninjatrader.com/support/forum...265#post503265
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Skifree, Yesterday, 01:33 PM
    6 responses
    53 views
    0 likes
    Last Post Skifree
    by Skifree
     
    Started by MJ123, Today, 04:06 PM
    2 responses
    15 views
    0 likes
    Last Post MJ123
    by MJ123
     
    Started by dgutz15, 12-12-2022, 11:50 PM
    4 responses
    63 views
    0 likes
    Last Post drsclaud23  
    Started by xtremel, Today, 08:48 PM
    0 responses
    14 views
    0 likes
    Last Post xtremel
    by xtremel
     
    Started by SilverSurfer1, Today, 08:27 PM
    0 responses
    5 views
    0 likes
    Last Post SilverSurfer1  
    Working...
    X