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

if a desired profit had been on the entry bar, what options do I have

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

    if a desired profit had been on the entry bar, what options do I have

    to exit the trade?

    Apart from SetProfitTarget, what other options do I have?

    Kay Wai

    #2
    Hi Kay Wai,

    You could submit a conditional market order while monitoring your unrealized PnL with GetProfitLoss().

    You could also use ExitLongLimit(), ExitShortLimit().

    In a backtest/historical: The timing of these orders will be one bar delayed from the entry bar, unless you follow principles in this reference sample to monitor for the entry order execution:
    The OnOrderUpdate() and OnExecution() methods are reserved for experienced programmers. Instead of using Set() methods to submit stop-loss and profit target orders, you can submit and update them manually through the use of IOrder and IExecution objects in the OnOrderUpdate() and OnExecution() methods. The OnOrderUpdate()


    In real time with CalculateOnBarClose = false, these orders can be submitted and conditions monitored on the entry bar.
    Ryan M.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Rapine Heihei, Today, 08:19 PM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by Rapine Heihei, Today, 08:25 PM
    0 responses
    5 views
    0 likes
    Last Post Rapine Heihei  
    Started by f.saeidi, Today, 08:01 PM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by Rapine Heihei, Today, 07:51 PM
    0 responses
    6 views
    0 likes
    Last Post Rapine Heihei  
    Started by frslvr, 04-11-2024, 07:26 AM
    5 responses
    98 views
    1 like
    Last Post caryc123  
    Working...
    X