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 ETFVoyageur, Yesterday, 07:05 PM
        4 responses
        30 views
        0 likes
        Last Post ETFVoyageur  
        Started by JGriff5646, Yesterday, 10:02 PM
        2 responses
        21 views
        0 likes
        Last Post JGriff5646  
        Started by DawnTreader, Today, 05:58 PM
        0 responses
        5 views
        0 likes
        Last Post DawnTreader  
        Started by ntram, Today, 05:39 PM
        0 responses
        5 views
        0 likes
        Last Post ntram
        by ntram
         
        Started by giulyko00, Today, 11:49 AM
        2 responses
        12 views
        0 likes
        Last Post giulyko00  
        Working...
        X