Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

MarketyReplay with 2 targets

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

    MarketyReplay with 2 targets

    I am writing a strategy that requires two separate profit targets but NT is exiting all shares on first target in market replay. Here is the code:


    protectedoverridevoid
    OnBarUpdate()
    {
    if (something is true)
    {
    entry = High[
    1]+ 0.02;
    stop = Low[
    2]- 0.03;
    target = High[
    1] + (entry - stop);



    SetStopLoss("ltarget1",CalculationMode.Price, stop,true);
    SetProfitTarget(
    "ltarget1",CalculationMode.Price, target);
    EnterLongLimit(shares, entry,
    "ltarget1");


    SetStopLoss("ltarget2",CalculationMode.Price, stop,true);
    SetProfitTarget(
    "ltarget2",CalculationMode.Price, (target + (target - entry)));
    EnterLongLimit(shares, entry,
    "ltarget2");
    }
    }

    #2
    Hello,

    Set TraceOrders = true; in your initialization and post what you get. It seems that you have it set up correctly with different signal names.

    This link may help:
    DenNinjaTrader Customer Service

    Comment


      #3
      It seems the name changes from ltarget1 and ltarget2 to Profit target

      FTI,Sell,384,47.65,9/26/2008 7:59:44 AM,e857f0ede7cb4e3eb8598d70d526a885,Exit,-,52a2cbc3b1d04a668f00fcb78ad4c9aa,Profit target,0.00,1,Replay101,Market Replay Connection,
      FTI,Sell,100,47.68,9/26/2008 7:57:00 AM,7911ee98affe4771a691b7de832ab5d9,Exit,384L,52a2 cbc3b1d04a668f00fcb78ad4c9aa,Profit target,0.00,1,Replay101,Market Replay Connection,
      FTI,Sell,100,47.65,9/26/2008 7:56:04 AM,59188bb647ab4826b5c23e1f76731e0f,Exit,484L,52a2 cbc3b1d04a668f00fcb78ad4c9aa,Profit target,0.00,1,Replay101,Market Replay Connection,
      FTI,Sell,2,47.65,9/26/2008 7:56:04 AM,f056524cd58c4d47b402c8f7b1108b82,Exit,584L,52a2 cbc3b1d04a668f00fcb78ad4c9aa,Profit target,0.00,1,Replay101,Market Replay Connection,
      FTI,Sell,2,47.67,9/26/2008 7:56:04 AM,670eb3eeac654a6cadfc9820066bbcf5,Exit,586L,52a2 cbc3b1d04a668f00fcb78ad4c9aa,Profit target,0.00,1,Replay101,Market Replay Connection,
      FTI,Sell,100,47.67,9/26/2008 7:56:04 AM,9de770a5fd064606aa038c60a2500aac,Exit,588L,52a2 cbc3b1d04a668f00fcb78ad4c9aa,Profit target,0.00,1,Replay101,Market Replay Connection,
      FTI,Sell,200,47.67,9/26/2008 7:56:04 AM,77f48e70c4884872a7f238ee6e3348c8,Exit,688L,52a2 cbc3b1d04a668f00fcb78ad4c9aa,Profit target,0.00,1,Replay101,Market Replay Connection,
      FTI,Sell,1,47.67,9/26/2008 7:56:04 AM,7d5773a322204a7da59cae515dece111,Exit,888L,52a2 cbc3b1d04a668f00fcb78ad4c9aa,Profit target,0.00,1,Replay101,Market Replay Connection,
      FTI,Sell,1,47.66,9/26/2008 7:56:04 AM,f7ceecc86eb246b7bedba4b4b7bafd95,Exit,889L,52a2 cbc3b1d04a668f00fcb78ad4c9aa,Profit target,0.00,1,Replay101,Market Replay Connection,
      FTI,Sell,3,47.66,9/26/2008 7:56:04 AM,ecb2c1a487a6402087afa65525daa9d4,Exit,890L,52a2 cbc3b1d04a668f00fcb78ad4c9aa,Profit target,0.00,1,Replay101,Market Replay Connection,
      FTI,Sell,1,47.66,9/26/2008 7:56:04 AM,9810854c7a5c4147a63ec86bad9c6e87,Exit,893L,52a2 cbc3b1d04a668f00fcb78ad4c9aa,Profit target,0.00,1,Replay101,Market Replay Connection,
      FTI,Sell,100,47.65,9/26/2008 7:56:04 AM,a9e42f08d251466fa705e88099a7f63d,Exit,894L,52a2 cbc3b1d04a668f00fcb78ad4c9aa,Profit target,0.00,1,Replay101,Market Replay Connection,
      FTI,Sell,3,47.65,9/26/2008 7:56:02 AM,90045014df1549329cf3f48f026670ed,Exit,994L,52a2 cbc3b1d04a668f00fcb78ad4c9aa,Profit target,0.00,1,Replay101,Market Replay Connection,
      FTI,Sell,1,47.65,9/26/2008 7:56:02 AM,ed89d39fd6c04f5db2f5fd012d0d0912,Exit,997L,52a2 cbc3b1d04a668f00fcb78ad4c9aa,Profit target,0.00,1,Replay101,Market Replay Connection,
      FTI,Sell,2,47.65,9/26/2008 7:56:02 AM,9fd37fe216eb404689c57b64fbdb29a1,Exit,998L,52a2 cbc3b1d04a668f00fcb78ad4c9aa,Profit target,0.00,1,Replay101,Market Replay Connection,
      FTI,Buy,496,47.33,9/26/2008 7:47:07 AM,75c4b628509142998227802b6fcba66c,Entry,1,000L,b 9ccbf97e0204ed9b354620877cb8987,ltarget2,0.00,1,Re play101,Market Replay Connection,
      FTI,Buy,4,47.32,9/26/2008 7:47:07 AM,334e420e3a9a4a1db04370466b71e9a2,Entry,504L,b9c cbf97e0204ed9b354620877cb8987,ltarget2,0.00,1,Repl ay101,Market Replay Connection,
      FTI,Buy,496,47.33,9/26/2008 7:47:07 AM,46b72e76f7c24b8e9662d784612f95ab,Entry,500L,534 4dfb4b8aa405ba142c20e9ec2eae3,ltarget1,0.00,1,Repl ay101,Market Replay Connection,
      FTI,Buy,4,47.32,9/26/2008 7:47:07 AM,a22560dcb9464678a03670e978eaefb7,Entry,4L,5344d fb4b8aa405ba142c20e9ec2eae3,ltarget1,0.00,1,Replay 101,Market Replay Connection,

      Comment


        #4
        Disregard my last post it is working now ( I changed the "Stop & Target submission" in the strategy dialogue to "PerEntryExecution")

        Comment


          #5
          Great, thanks for letting us know.
          RayNinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          633 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          364 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          105 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          567 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          568 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X