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

Percent targets

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

    Percent targets

    Hi

    Can anyone please provide me a simple strategy builder code line for NT8 that executes this on a 30 minute chart frame:

    Profit target

    Currently have 200 shares of a xyz long

    want to execute 100 shares at 10% increase in price.

    want to execute 100 shares at 20% increase in price.

    This is not achievable thru SetProfitTarget since it only exits the entire position. I need to scale out without creating 2 different entry signals.

    I want to have one entry signal and 2-3 profit targets.

    thanks in advance

    #2
    Hello Deanmadar,

    Thank you for your note.

    You could see the following example on scaling out of a position,


    What you could do is enter two long positions for the same product, each with a unique name, 100 shares each, and then use setprofittaget for each. Under this approach you would set EntryHandling = EntryHandling.UniqueEntries; and EntriesPerDirection to 1.

    This will allow, EnterLong("LongA") and EnterLong("LongB") to be executed.

    Then you can use,
    Code:
    SetProfitTarget("LongA", CalculationMode.Ticks, 10)
    SetProfitTarget("LongB", CalculationMode.Ticks, 20)
    Please see,



    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by bortz, 11-06-2023, 08:04 AM
    47 responses
    1,603 views
    0 likes
    Last Post aligator  
    Started by jaybedreamin, Today, 05:56 PM
    0 responses
    8 views
    0 likes
    Last Post jaybedreamin  
    Started by DJ888, 04-16-2024, 06:09 PM
    6 responses
    18 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by Jon17, Today, 04:33 PM
    0 responses
    4 views
    0 likes
    Last Post Jon17
    by Jon17
     
    Started by Javierw.ok, Today, 04:12 PM
    0 responses
    12 views
    0 likes
    Last Post Javierw.ok  
    Working...
    X