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

Automated stop loss per indicator

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

    Automated stop loss per indicator

    Hello, I currently have a custom indicator that shows entries (green horizontal line) for breakouts (orange BO circle), and a stop loss (blue or red dotted line depending on if its long or short)

    I have automated my entries at the horizontal line with the strategy builder but cannot find a way to automatically set the stop loss to the indicators. The indicator has signal plots like "2" for a BreakoutLong.

    Talking to the developer, he stated that "the stop line was exported as a plot" but I dont understand how to use this in my strategy.

    As of now entries are like this:
    Condition
    Indicator(10,4).Signal[0]=2
    Action
    EnterLongStopMarket(DefaultQuantity, (High[0]+1 * TickSize)), @"Long")

    If I can provide any more information on my end please let me know thank you!
    Attached Files

    #2
    Hello Brandon9821,

    If the developer exported the data as a Plot then you have used it correctly. The builder can only access indicator data which are plots.

    The builders stops and targets page is not able to be used for dynamically generated prices, it would need to be an offset based on the entries fill price. If you are looking to make targets based on an indicator value you would need to use logic and a Set to do that by submitting your own order.

    You can find an example of making a breakeven stop in the builder in the following post: https://ninjatrader.com/support/foru...rategy-builder

    The same concept would be needed if you wanted to dynamically price a stop based on some indicator or price value. A variable with the price you want could be used and then you would submit an order using the variable as the orders price.

    I look forward to being of further assistance.


    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by ebaydan777, Today, 02:41 PM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_ChrisL  
    Started by aligator, Today, 02:28 PM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_ChristopherJ  
    Started by daniel_weber8, Today, 01:21 PM
    1 response
    22 views
    0 likes
    Last Post NinjaTrader_ChristopherS  
    Started by jungsoohuh, Today, 12:07 PM
    1 response
    28 views
    0 likes
    Last Post NinjaTrader_PaulH  
    Started by SharonSS, Today, 11:54 AM
    2 responses
    24 views
    0 likes
    Last Post SharonSS  
    Working...
    X