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

Coding a Variable

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

    Coding a Variable

    I would like to generate a variable based on two stock prices to use in my order entry.

    Instead of EnterShort(Default) I want it to EnterShort(myVariable)

    How do I code in Ninja Script the formula for a variable:
    (Price of Stock A/Price of Stock B)= myVariable

    I have very limited C# experience.

    #2
    Hi vt2009,

    This would require using a multi-instrument strategy.



    This will also be available in indicators with the release of NinjaTrader 7.
    More on NT7 - http://www.ninjatrader.com/webnew/NT7/NinjaTrader7.html
    TimNinjaTrader Customer Service

    Comment


      #3
      This seems to be the link I am always given...is there an example of myVariable code I could look at? Its really simple I'm sure

      Comment


        #4
        Hi vt2009,

        Unfortunately, I don't have a specific sample available for this specific topic, however there is also a sample Strategy loaded by default in NinjaTrader if you want another example of the use of multi-instrument strategies.

        (Tools>Edit NS>Strategy>SampleMultiInstrument)
        Last edited by NinjaTrader_Tim; 03-24-2010, 07:50 AM.
        TimNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by GussJ, 03-04-2020, 03:11 PM
        11 responses
        3,221 views
        0 likes
        Last Post xiinteractive  
        Started by andrewtrades, Today, 04:57 PM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by chbruno, Today, 04:10 PM
        0 responses
        7 views
        0 likes
        Last Post chbruno
        by chbruno
         
        Started by josh18955, 03-25-2023, 11:16 AM
        6 responses
        438 views
        0 likes
        Last Post Delerium  
        Started by FAQtrader, Today, 03:35 PM
        0 responses
        9 views
        0 likes
        Last Post FAQtrader  
        Working...
        X