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

Simulated Profit Target Order

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

    Simulated Profit Target Order

    Hi,

    I have a stop loss and profit target orders as shown below.

    SetStopLoss("", CalculationMode.Ticks, 40,true);
    SetProfitTarget("", CalculationMode.Ticks, 100, true );

    “true at the end in StopLoss order makes it simulated, meaning the order stays on my server till price hits my stop then it will send market order to broker to close the position. But, the broker wont have my stop loss order information till it is already hit. This is working as it supposed to.

    Now, I don’t want the broker to see my resting profit target order. I want it to be sent to broker only after price crosses profit target. The “true” part at the end here is for MIT (market if touched) but Ninja is not making it a simulated order and immediately submitting it to the broker and I can see resting profit target order on the broker side.

    So, is there a way to make this default SetProfitTarget as a simulated order? Or do we have to resort to using some other order types to achieve it? If stop loss order can be simulated, profit target order should also be easily made simulated.

    Any help will be appreciated. Thank you.
    MJ

    #2
    Hello MJ123,

    There is not an option to simulate profit target orders by default. To do that you would need to not submit a target and instead use logic to control when you submit an exit order or exit limit type order.

    JesseNinjaTrader Customer Service

    Comment


      #3
      Thanks Jesse. Thats a bummer and does not make sense on why Ninja would make it available for stops but not for targets.
      Can you give an example of simulated profit target order done using other order types? The key is, OCO with stop loss orders. This is why I am looking for profit target order default.
      Any target exit order needs to be tied with stop loss and when target order is filled, stop loss needs to be cancelled and vice versa.

      Comment


        #4
        Hello MJ123,

        I am not aware of a specific sample that I could link to for that concept. When doing a simulated target order the order is only triggered once a price condition becomes true so you would mainly just have to make a condition for when you want the exit to occur and then submit a exit order at that time.

        If you were doing a simulated stop and target I would suggest to not use the SetStopLoss in that case. While the SetStopLoss would technically get cancelled once the associated position closes it would be best to have two exit conditions to control the stop and target instead. That is so the conditions can be controlled together.

        If you make two conditions to exit you would have either the stops condition become true or the targets condition become true based on where the market goes. Once one of the exit orders fill and you become flat you could disable the exit conditions from happening so no additional orders would be submitted. A simple way to do that would be to add a condition into the exit conditions checking if the position is not flat, once the position is flat the exit conditions would not work.



        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Haiasi, 04-25-2024, 06:53 PM
        2 responses
        17 views
        0 likes
        Last Post Massinisa  
        Started by Creamers, Today, 05:32 AM
        0 responses
        5 views
        0 likes
        Last Post Creamers  
        Started by Segwin, 05-07-2018, 02:15 PM
        12 responses
        1,786 views
        0 likes
        Last Post Leafcutter  
        Started by poplagelu, Today, 05:00 AM
        0 responses
        3 views
        0 likes
        Last Post poplagelu  
        Started by fx.practic, 10-15-2013, 12:53 AM
        5 responses
        5,408 views
        0 likes
        Last Post Bidder
        by Bidder
         
        Working...
        X