Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help with strategy

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

    Help with strategy

    Hi, I need help with strategy that i have been working on to hedge my portfolio sometimes.

    I am always long by nature(meaning. have an opinion that market will eventually go up).
    So i placed 1 long MNQ position on my /MNQ-09 contract at 18800 (as an example)


    As these days, there are wild moves over night or intraday(5-7% up or down), I want to hedge my long position while i am sleeping and take advantage of gains from the hedging as well..
    So for that reason, i want to run(start) a strategy on my /MNQ-06 instrument after i manually go long on /MNQ - 09 contract.

    What strategy has to do is - if the market falls to hedgevalue(this will be an input value to the strategy) (for ex: 18000 on /MNQ-06), i have to go short on /MNQ-06 contract and a stop loss of 30 points(for this ex: it will be 18030).(stoploss will also be an input value to the strategy)

    In order to achieve this, i created set-1:

    which looks for "if the current market position is LONG ( which is from the manual trade taken on /MNQ-09 contract)." ( will the strategy know even though the trade is not taken using strategy and if taken manually? How can i achieve this? Do i have to enable any settings in the strategy for the account and the strategy to be in sync?) ( i always start the strategy after i manually take a long trade, so this condition has to always become true for me when i start the strategy)
    and if the current price is greater than the hedgevalue ( i always start the strategy with the hedge value less than the current price, so this condition has to always become true for me when i start the strategy),
    then i need to place a "Enter Short Stop Limit" order:


    Click image for larger version

Name:	image.png
Views:	168
Size:	3.7 KB
ID:	1340289


    By doing this, what has to happen is "As soon as i start the strategy, a short stop limit order" has to be placed at the hedgevalue(input variable) and if the price keeps going down and eventually reaches hedge value(ex: 18000), the limit order has to be executed with a SL of 30 points. So by this time: i have to be short on /MNQ-06 at 18000 (with a stop loss of 30 points) and long on /MNQ-09 at 18800(manual trade taken).
    If on /MNQ-06 contract, if the price never hits the SL and keeps going down, i will eventually take profits manually or think of booking profits after 500 points down or so.
    But if it hits the SL(18030), i will have a 30 point loss but atleast i will have a safe sleep due to these wild swings.


    And also, after hitting my SL, there is always a chance that the price might come down again and go 500 points down.
    But as my strategy is till runnning and if the price hits my SL, then that means, it is above my hedgevalue and i am also long on /MNQ-09 contract

    So set-1 condition should satisfy and again place a "Enter Short Stop Limit" order at 18000.
    Like this, the process has to continue for ever.



    Is this possible at all?

    I exactly did what i mentioned above and it did not work.
    I do not see any "Short Stop Limit" order placed at 18000 on the charts.

    This is the NS output:

    Click image for larger version

Name:	image.png
Views:	146
Size:	11.2 KB
ID:	1340293

    It seems like my manual long is not being recognized once i start the strategy. Is it so? How can i achieve this?

    Mor details:


    I have started the strategy with this properties on /MNQ-06 contract

    Click image for larger version

Name:	image.png
Views:	153
Size:	82.2 KB
ID:	1340290


    Strategy enabled:

    Click image for larger version

Name:	image.png
Views:	146
Size:	19.4 KB
ID:	1340292​​



    And i am already long manually on /MNQ-09 contract:

    Click image for larger version

Name:	image.png
Views:	146
Size:	12.3 KB
ID:	1340291

    #2
    Sorry to post the topic in ninjatrader 7 but i am running the strategy on Ninja 8

    Comment


      #3
      Hello psangram,

      I've moved the thread from the NinjaTrader 7 > Strategy Development​ section of the forums to the NinjaTrader Desktop > Strategy Development section of the forums as from the screenshots this does not appear to be for NinjaTrader 7.

      Unfortunately, the Strategy Builder cannot make a strategy that places trades to a secondary instrument.

      The script would have to be unlocked and coded by hand.

      Included with NinjaTrader is the SampleMultiInstrument that demonstrates adding a secondary series of a different instrument with AddDataSeries().

      ​Each series will update OnBarUpdate(). The BarsInProgress property will reflect the index of the series currently updating OnBarUpdate().

      Order methods will have an overload signature with a barsInProgressIndex which will allow you to specify which series (which instrument) an order is submitted to.

      EnterLong(int barsInProgressIndex, int quantity, string signalName)
      Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.


      Below are links to the documentation.
      Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.

      Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.

      Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.

      Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.


      I am also including a link to a support article with helpful resources on getting started with C# and NinjaScript.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        Thank you. Let me review these articles, try and get back to you.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        547 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        323 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        99 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        543 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        545 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X