Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Generate on Mini, execute on Micro

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

    Generate on Mini, execute on Micro

    So, id like to automate generating signals on 'Primary' contract, but execute market orders on Micro contracts.
    Found Two processes mentioned elsewhere. One related to intrabar fill granularity and two series in same script; the other related to calling an ATM script with the alternate contract.

    Between these two concepts (or a different one) which might be the most straight forward / robust path to 'running my strategy on the Mini, but executing on the Micro?'
    -Currently I run the strategy on both contracts separately (one live, one sim), and correct positions manually when they get out of sync. The larger contract I consider more reliable for signal generation(primary)... This seems unnecessarily stressful, eh.

    The two semi relevant posts I mentioned were:

    1- https://ninjatrader.com/support/help...ipt_strate.htm

    2- https://ninjatrader.com/support/foru...ry-data-series

    Let me know if I need to clarify further, I appreciate your guidance!

    hmm(I suppose the issue with this Is id lose accountability for the actual micro position)

    -Sorry, additional thoughts... Part of strategy involves actual position PL. as input on whether to take next signal. So maybe? Run strategy in sim account but somehow mimic position in an ATM? ---rabbit hole, there are targets and stop.
    Last edited by RedRock; 01-14-2023, 03:40 PM. Reason: More thoughts...

    #2
    Hello RedRock,

    Thanks for your post.

    This could be accomplished by adding an additional bars object to the strategy using AddDataSeries() for the Micro instrument you want to use and submitting your orders to that added secondary series.

    See this help guide page for information about using the AddDataSeries() method to add secondary bars objects to your script: https://ninjatrader.com/support/help...dataseries.htm

    Atm Strategy Methods could be used to place an entry order with protective orders attached that are controlled by an Atm Strategy template as mentioned in the forum thread link you shared.

    See this help guide page for more information about using Atm Strategy Methods: https://ninjatrader.com/support/help...gy_methods.htm

    And, view this help guide page for further information about using Atm Strategy Templates in a custom NinjaScript strategy: https://ninjatrader.com/support/help...strategies.htm

    The SampleIntrabarBacktest reference sample link you shared could be viewed to see an example of how to submit orders to an added secondary series.

    Please review this help guide page to gain a good understanding about working with Multi-Instrument/Multi-Timeframe NinjaScripts: https://ninjatrader.com/support/help...nstruments.htm

    Note that NinjaScript strategies are only able to see orders submitted by that specific instance of the strategy, not manually placed orders. If you manually place an order on the same instrument and account that a strategy is running on it would cause the strategy's Sync column to be False in the Strategies tab of the Control Center.

    Let me know if I may further assist.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      I think my answer lies in the attached link.


      But, Question though, WHY might someone want to submit an order to ATM. Only to manage outside the strategy? Any advantage or opportunities not found within the strategy?​

      Comment


        #4
        Hello RedRock,

        Thanks for your note.

        Using Atm Strategy Methods would allow you to submit protective orders that are controlled by the Atm Strategy Template that you created instead of hard-coding the order handling for submitted orders within the strategy itself.

        Note that NinjaScript strategies are intended to run without manual intervention.

        Please let me know if I may assist further.
        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment


          #5
          Hi Brandon.

          An issue im hitting is that my entry logic uses real time open position P/L as a condition for subsequent trade activity. If the strategy is run live or in sim account, that PL is utilized.
          So, when submitting orders to my secondary series, that PL data for the primary series is unavailable as no trade was executed on the primary. I would need to send the primary to sim and the secondary [micro] order to live broker. That isnt possible as I understand it? Im thinking two possible solutions. 1. Somehow create a phantom position for the primary which is internal to the strategy to track phantoms theoretical open PL. Or 2. If possible obtain the actual PL from the secondary instrument from broker?

          As a workaround, is it possible to run a strategy primary series order on sim account to obtain PL, But then use an ATM on secondary series instrument. In that case can the account for the ATM position be different than the running strategy sim account? (is the atm linked to the strategy account, or selectable in the atm)

          Appreciate your thoughts!!!
          rr

          Comment


            #6
            Hello RedRock,

            Thanks for your note.

            Please see the forum thread post linked below from my colleague Chelsea which talks about getting the UnrealizedProfitLoss value of a Position from an added secondary series.

            Hello, I want to know how one can get the current open unrealized PnL of 2 different instruments. Suppose a strategy opens 2 orders for 2 instruments in long and short positions, then is there a method to get current total unrelized pnL? Thanks.


            Let me know if I may assist further.
            <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

            Comment


              #7
              Brandon, Awesome! ThankYou...

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by NullPointStrategies, 03-13-2026, 05:17 AM
              0 responses
              82 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              150 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              79 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              52 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              59 views
              0 likes
              Last Post TheRealMorford  
              Working...
              X