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

Using indicator value to create stop loss/profit target upon order entry

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

    Using indicator value to create stop loss/profit target upon order entry

    Is there a way to build a strategy (either ATM or Ninjascript) that would take into account an indicator value (say, the ATR) and use that for stop loss/profit targets?

    Example would be I enter a trade and I want my stop loss set at 1x ATR away from my entry and my profit target set 2x ATR away.

    #2
    Hi jpietkewicz, thanks for posting and welcome to the NinjaTrader forums.

    A fully automated strategy will need to be made to use the ATR value. You can use the strategy builder to add a parabolic stop, which is similar to an ATR stop, or you can make an unlocked script that uses indicator data explicitly e.g.

    if(<Entry Condition>)
    {
    SetStopLoss(CalculationMode.Price, Low[0] - ATR(20)[0])
    EnterLong(1);
    }

    Best regards,
    -ChrisL
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Thank you ChrisL that makes sense. Is there a way to do this where I put in my order entry from Chart Trader or SuperDOM? Like <Entry Condition> being OnClick() in a GUI application kind of thing if that makes sense?

      Comment


        #4
        Hi jpietkewicz, thanks for your reply.

        You can add buttons to your chart through the strategy and submit orders on the button click event. Make sure to use TriggerCustomEvent when inside the click event.

        Alternatively, you can go with an Addon style Account object. I attached an example to this post for reference. To test it out, place the .cs file within Documents\NinjaTrader 8\bin\Custom\Indicators and compile.

        Best regards,
        -ChrisL


        Attached Files
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by sofortune, Yesterday, 11:48 AM
        2 responses
        23 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by Zach55, 02-19-2024, 07:22 PM
        2 responses
        59 views
        0 likes
        Last Post lbadisa1  
        Started by JGriff5646, Today, 05:47 PM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by AlphaOptions, 06-18-2013, 08:24 AM
        9 responses
        2,200 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by ttrader23, Today, 09:33 AM
        3 responses
        23 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Working...
        X