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 trilliantrader, 04-10-2024, 09:33 PM
        6 responses
        25 views
        0 likes
        Last Post trilliantrader  
        Started by traderqz, Today, 12:06 AM
        5 responses
        10 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by Mongo, Today, 11:05 AM
        2 responses
        9 views
        0 likes
        Last Post Mongo
        by Mongo
         
        Started by guillembm, Today, 11:25 AM
        0 responses
        4 views
        0 likes
        Last Post guillembm  
        Started by Tim-c, Today, 10:58 AM
        1 response
        3 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X