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

Help with coding please

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

    Help with coding please

    I'm new to NT8 code and only an amateur with coding in general.

    I'm trying to find a way to code an entry signal for example. The High/Low of the last bar is Within "X" amount of Ticks from EMA(34)[1].

    Can someone help me with this please?

    Thanks.

    #2
    Hello Displacer,

    Thank you for your post.

    I've put together a quick example screenshot of how you could do this in the Strategy Builder. The below screenshot shows how you'd find out if the High of the previous bar is within 10 ticks above the EMA(34) of the previous bar. It would then submit an order if the price is between the EMA(34)[1] and 10 ticks above it.

    Click image for larger version

Name:	2019-05-24_1515.png
Views:	532
Size:	70.9 KB
ID:	1058730

    We do have resources to help you begin creating NinjaScript Strategies/Indicators, however, we do not provide programming education services in the Support department. All links below are publicly available.

    The best way to begin learning NinjaScript is to use the Strategy Builder. With the Strategy Builder you can setup conditions and variables and then see the generated code in the NinjaScript Editor by clicking the View Code button.

    I'm also providing a link to a pre-recorded set of videos 'Strategy Builder 301' and 'NinjaScript Editor 401' for you to view at your own convenience.

    Strategy Builder 301
    NinjaScript Editor 401

    If you are new to C#, to get a basic foundation for the concepts and syntax used in NinjaScript I would recommend this section of articles in our NT7 help guide first:

    Basic Programming Concepts

    For general C# education I have personally found Dot Net Perls to be a great reference site with easy to understand examples.

    Browse examples for many languages, with explanations and code side by side for easy understanding.


    There are a few Sample Automated Strategies which come pre-configured in NinjaTrader that you can use as a starting point. These are found under New -> NinjaScript Editor -> Strategy. You will see locked strategies where you can see the details of the code, but you will not be able to edit (you can though always create copies you can later edit via right click > Save as)
    We also have some Reference samples online as well as ‘Tips and Tricks’ for both indicators and strategies:

    Click here to see our NinjaScript Reference Samples
    Click here to see our NinjaScript Tips

    These samples can be downloaded, installed and modified from NinjaTrader and hopefully serve as a good base for your custom works.

    Also, below I am also linking you to the Educational Resources section of the Help Guide to help you get started with NinjaScript.



    Further, the following link is to our help guide with an alphabetical reference list to all supported methods, properties, and objects that are used in NinjaScript.

    Alphabetical Reference

    And our Educational Resources in the NinjaTrader 8 help guide.

    Educational Resources

    A set of specific tutorials for creating conditions in the NinjaTrader 8 Strategy Builder in the NinjaTrader 8 help guide.

    Condition Builder

    You can also contact one of our professional NinjaScript Consultants or Educators who would be eager to create or modify this script at your request or assist you with your script. Please let me know if you would like a list of professional NinjaScript Consultants or Educators who would be happy to create or modify any script at your request or assist you in learning NinjaScript.

    Please let me know if I may be of further assistance.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Ya know, I didn’t even think to check and see if it was in the strategy builder.. I’ve written some code with the editor for a few strategies for NT7 with no problem But NT8 is a little different and im still learning it..

      Thank You for your help!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by trilliantrader, 04-18-2024, 08:16 AM
      4 responses
      18 views
      0 likes
      Last Post trilliantrader  
      Started by mgco4you, Today, 09:46 PM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by wzgy0920, Today, 09:53 PM
      0 responses
      9 views
      0 likes
      Last Post wzgy0920  
      Started by Rapine Heihei, Today, 08:19 PM
      1 response
      10 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by Rapine Heihei, Today, 08:25 PM
      0 responses
      10 views
      0 likes
      Last Post Rapine Heihei  
      Working...
      X