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

EnterLongStopLimit

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

    EnterLongStopLimit

    Greetings,

    I want to make sure one thing:
    If an EnterLongStopLimit() is executed in my strategy, the order will NOT be entered "right away", right!?
    It will only enter when the limit price is hit, right!?
    And if the "Stop Price" is hit, the order will be canceled EVEN IF the order is NEVER entered!?

    Thank you very much for your help!

    #2
    Hello YoutingChu,

    Thank you for the note.

    A buy stop limit order is a type of order that can be placed above the market price. It will only be executed if the market reaches the limit price or better, up to the stop price. The order would not automatically cancel itself. To cancel an order, you would need to use CancelOrder().

    Please let me know if I can assist further.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Dear Chris,

      Thank you very much for your help!
      I have to admit that all these Enter stuff confused the crap out of me! >3<
      So I guess it will be easier if I just tell you what I'm trying to do.

      Take a long position as an example,
      If the current price is 100, I would like to place a long order if it hit 110, with both StopLoss and ProfitTarget of 10.
      And cancel the order if it hit 90.

      Thank you very much for your help!

      Comment


        #4
        Hello YoutingChu,

        Thanks for the post.

        If you would like to monitor the price and enter the market yourself, I would recommend using an ATM Strategy. In Chart Trader, you can select an ATM strategy to use then place an order at your desired price. When the order is filled, an OCO stop and target will be created automatically.

        Below I have also included a public link to our YouTube video on using ATM's:

        https://www.youtube.com/watch?v=Gnyx8RSp3EI&t=824s

        To implement a strategy around this, I recommend defining entry and exit conditions for your strategy first. The SampleMACrossover strategy is a good introductory strategy that flip-flops between long and short based on two SMAs crossing each other.

        I have attached a simple strategy that utilizes SetStopLoss and SetProfitTarget to set up protective orders for entries made by the strategy. The entry condition was made up just for the example, a simple check if the CLose price crosses above the EMA.

        You may import the .zip file by going to Tools>Import>NinjaScript Addon. Say "No" to replacing the @EMA.cs file.

        Please let me know if I can assist further.
        Attached Files
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by kujista, Today, 05:44 AM
        2 responses
        11 views
        0 likes
        Last Post kujista
        by kujista
         
        Started by trilliantrader, Today, 08:16 AM
        0 responses
        3 views
        0 likes
        Last Post trilliantrader  
        Started by AttiM, 02-14-2024, 05:20 PM
        9 responses
        174 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by funk10101, Today, 08:14 AM
        0 responses
        2 views
        0 likes
        Last Post funk10101  
        Started by adeelshahzad, Today, 03:54 AM
        1 response
        13 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Working...
        X