Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

More than one TP and STP for the same order

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

    More than one TP and STP for the same order


    Hello ,

    when I create an order with 10 contracts, I get a TP divided in two with two prices
    how do I get all the contracts in a single TP that contains all the contracts? Thanks​
    below is my code :

    EnterLong(10,"Achat");
    SetStopLoss(CalculationMode.Ticks, 30);
    SetProfitTarget(CalculationMode.Ticks, 40);​​

    Click image for larger version

Name:	image.png
Views:	90
Size:	27.9 KB
ID:	1285104

    #2
    Hi scalping_Strategy​,

    What is happening is that you're getting partial fills at different prices. I'd recommend setting your targets/stops based on prices and not ticks.

    Hope that helps,
    Matt

    Comment


      #3
      Hello scalping_Strategy,

      Thanks for your post.

      Matt is correct and has provided some great information on this topic.

      Another thing to keep in mind is the Set methods should be called before the Enter method in your script.

      For example:

      SetStopLoss();
      SetProfitTarget();
      EnterLong();

      From the SetStopLoss()/SetProfitTarget() help guide pages: "Since they are submitted upon receiving an execution, the Set method should be called prior to submitting the associated entry order to ensure an initial level is set."

      SetStopLoss(): https://ninjatrader.com/support/help...etstoploss.htm
      SetProfitTarget(): https://ninjatrader.com/support/help...ofittarget.htm
      Brandon H.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Graci117, Today, 09:02 PM
      1 response
      4 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by ETFVoyageur, Today, 07:55 PM
      0 responses
      7 views
      0 likes
      Last Post ETFVoyageur  
      Started by janio973, Today, 07:24 PM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by aligator, 01-06-2022, 12:14 PM
      4 responses
      246 views
      0 likes
      Last Post john_44573  
      Started by reynoldsn, Today, 05:56 PM
      0 responses
      14 views
      0 likes
      Last Post reynoldsn  
      Working...
      X