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

Stop loss

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

    Stop loss

    Hi
    how do I go about iabout anti to have ema as my entry and exit but sometimes using ema as exit can be a big loss. How do I also add a 30 points stop loss along with ema crossing, which ever come first.

    If it can be don't on strategies builder.

    #2
    Hello SuperDude123,

    Are you asking how to make a condition that uses the EMA for deciding to enter or exit? Are you asking how to use the EMA price for order placement?

    For any type of logic with targets like setting a stoploss or alternatively doing an exit you would have to avoid using the stops and targets page of the builder, that page is for fixed targets that use a pre defined value. You can find an example of working with targets here: https://ninjatrader.com/support/foru...rategy-builder
    JesseNinjaTrader Customer Service

    Comment


      #3
      I'm trying to used ema and set stop loss, which ever come first

      Comment


        #4
        Hello SuperDude123,

        If you are trying to use either the EMA as an exit or a stoploss you would have to use logic like the linked break even sample to do that. You would need to use a variable to control if the stoploss order is being resubmitted on each bar. Resubmitting the order on each bar holds it open, once the order is expired you could use another set to exit using a market order.


        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Vulgoth_t_Destroyer, 05-09-2022, 04:45 PM
        55 responses
        5,455 views
        0 likes
        Last Post BartMan
        by BartMan
         
        Started by DawnTreader, 05-08-2024, 05:58 PM
        16 responses
        52 views
        0 likes
        Last Post DawnTreader  
        Started by tradingnasdaqprueba, 05-07-2024, 03:42 AM
        15 responses
        61 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by kevinenergy, Yesterday, 12:01 PM
        8 responses
        28 views
        0 likes
        Last Post kevinenergy  
        Started by nightstalker, Today, 01:32 PM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_Zachary  
        Working...
        X