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 FrazMann, Today, 11:21 AM
          0 responses
          3 views
          0 likes
          Last Post FrazMann  
          Started by geddyisodin, Yesterday, 05:20 AM
          8 responses
          52 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by cmtjoancolmenero, Yesterday, 03:58 PM
          10 responses
          38 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by DayTradingDEMON, Today, 09:28 AM
          4 responses
          24 views
          0 likes
          Last Post DayTradingDEMON  
          Started by George21, Today, 10:07 AM
          1 response
          21 views
          0 likes
          Last Post NinjaTrader_ChristopherJ  
          Working...
          X