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 CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        28 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        20 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        183 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        336 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        260 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X