Announcement

Collapse
No announcement yet.

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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        580 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        335 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        102 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        554 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        552 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X