Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exit based off previous bars

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

    Exit based off previous bars

    Good Afternoon!

    Trying to use the search function didnt get me much as this is really specific.

    Like most of you I am trying to automate what i do manually. That is, set my exit based off two bar's ago's close low (long)/high(short)

    I have tinkered with set Profit Targets, Trailing Stops and it's not working.

    When i am manually trading and am long; with each new candle i'll move the stop loss to the bottom of the candle 2 candles ago.

    does that make sense?


    Thanks in advance,

    CM.

    #2
    Hello CM,

    I have an example that demonstrates changing the price of an exit order. You can do this when a bar closes, or by adding intra-bar data having trailing and chasing actions happen intra-bar.

    http://ninjatrader.com/support/forum...993#post502993
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      thanks!

      i downloaded the first zip, i just copy and paste into my code and adjust the integers correct?

      Comment


        #4
        Hello Mossive,

        This is meant to be an example.

        I would recommend starting a new strategy and uses this as an example to model your code after, but custom for what you are trying to do.

        Calculating the daliy loss is not necessary as this is not the conditions you want in your script.

        Instead, you would want to create triggers in OnExecution for when the stop loss or exit order fills.


        To import a NinjaScript into NinjaTrader 8 do the following:
        1. Download the script to your desktop, keep it in the compressed .zip file.
        2. From the Control Center window select Tools -> Import -> NinjaScript...
        3. Click the Desktop icon on the left to navigate to the desktop
        4. Select the downloaded .zip file -> then click Open
        5. NinjaTrader will then confirm if the import has been successful.


        Critical *Note that on any files that say "File already exists on your PC" that start with an "@" symbol are the ones that came preloaded inside of NinjaTrader so you would say "No" so that you do not override those files.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by asgandabdoil, Yesterday, 10:48 PM
        0 responses
        3 views
        0 likes
        Last Post asgandabdoil  
        Started by asgandabdoil, Yesterday, 10:47 PM
        0 responses
        5 views
        0 likes
        Last Post asgandabdoil  
        Started by soon123, Yesterday, 07:37 PM
        2 responses
        11 views
        0 likes
        Last Post s.kinra
        by s.kinra
         
        Started by MKV17, Yesterday, 07:16 PM
        0 responses
        7 views
        0 likes
        Last Post MKV17
        by MKV17
         
        Started by BrennanSalibrici, Yesterday, 07:03 PM
        0 responses
        4 views
        0 likes
        Last Post BrennanSalibrici  
        Working...
        X