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 Profits - How to Reverse a Trailing Stop?

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

    Trailing Profits - How to Reverse a Trailing Stop?

    Hello,

    I have system using a trailing stop as follows:

    protected override void Initialize()
    {
    SetTrailStop("", CalculationMode.Ticks, 60, true);

    CalculateOnBarClose = true;
    }

    protected override void OnBarUpdate()
    {
    if ()
    {
    EnterShort(DefaultQuantity, "");
    }

    }

    I'd like to reverse the trailing stop, so that I would go long instead of short and when the trailing "stop" was hit, it would be a take profit. I can't think how I could do this, low-intermediate coding skills so thanks for your patience,

    Jeremy

    #2
    jeremymgp,

    If you did EnterShort() and had a short position and you called EnterLong() it will reverse you into a long position, cancel the original trailing stop, and finally place you in a new trailing stop that is in the appropriate direction.
    Josh P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by esmall, Today, 07:14 PM
    0 responses
    1 view
    0 likes
    Last Post esmall
    by esmall
     
    Started by Option Whisperer, 05-09-2024, 07:58 PM
    6 responses
    25 views
    0 likes
    Last Post Option Whisperer  
    Started by rayyyu12, Today, 05:38 PM
    0 responses
    12 views
    0 likes
    Last Post rayyyu12  
    Started by xepher101, Yesterday, 12:19 PM
    2 responses
    30 views
    0 likes
    Last Post xepher101  
    Started by thumper57, Today, 04:30 PM
    0 responses
    8 views
    0 likes
    Last Post thumper57  
    Working...
    X