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

Trailing Stop Strategy

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

    Trailing Stop Strategy

    I’m running a strategy with a trailing stop of (for example) 20 ticks on my first contract. My strategy also sizes up, so at a certain point I have 2 contracts, but what I want to do is to tighten my 2 trailing stops so that the cash value of any loss would not exceed the original 20 ticks?
    In other words, instead of a trailing stop using points, what I am trying to achieve is a trailing stop using a total unrealized cash amount the strategy can lose regardless if I have more than 1 contract.
    Any thoughts would be gratefully received.
    Thanks
    Last edited by John833; 09-25-2008, 06:16 AM.

    #2
    Hello,

    You will need to find the value of the 20 ticks in currency then you can use SetTrailStop(...some value here...). This link will help:

    DenNinjaTrader Customer Service

    Comment


      #3
      Thanks Ben for your reply

      I’m looking at the help guide, but I'm still struggling....
      So if I want to have a trailing stop in currency, which will exit positions (regardless of size of position) at a specified unrealized loss,
      The help guide has:

      SetTrailStop(double currency)

      So would the code look something like this?

      protected override void Initialize()
      {
      // Sets a trail stop of $1000 regardless of position size
      SetTrailStop(double.1000);
      }

      I don’t seem to be able to get this to work…. Do you have any idea what I am doing wrong?
      Last edited by John833; 09-25-2008, 08:59 AM.

      Comment


        #4
        Hello,

        Use something like this:

        SetTrailStop(1000);
        DenNinjaTrader Customer Service

        Comment


          #5
          thanks Ben for your help, I'll try this out....

          Regards

          John

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by DJ888, 04-16-2024, 06:09 PM
          6 responses
          18 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by Jon17, Today, 04:33 PM
          0 responses
          1 view
          0 likes
          Last Post Jon17
          by Jon17
           
          Started by Javierw.ok, Today, 04:12 PM
          0 responses
          6 views
          0 likes
          Last Post Javierw.ok  
          Started by timmbbo, Today, 08:59 AM
          2 responses
          10 views
          0 likes
          Last Post bltdavid  
          Started by alifarahani, Today, 09:40 AM
          6 responses
          41 views
          0 likes
          Last Post alifarahani  
          Working...
          X