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 Waxavi, Today, 02:10 AM
    0 responses
    2 views
    0 likes
    Last Post Waxavi
    by Waxavi
     
    Started by TradeForge, Today, 02:09 AM
    0 responses
    4 views
    0 likes
    Last Post TradeForge  
    Started by Waxavi, Today, 02:00 AM
    0 responses
    2 views
    0 likes
    Last Post Waxavi
    by Waxavi
     
    Started by elirion, Today, 01:36 AM
    0 responses
    4 views
    0 likes
    Last Post elirion
    by elirion
     
    Started by gentlebenthebear, Today, 01:30 AM
    0 responses
    4 views
    0 likes
    Last Post gentlebenthebear  
    Working...
    X