Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trailstop 1 tick below BID for long trades and 1 tick above ASK for short trades

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

    Trailstop 1 tick below BID for long trades and 1 tick above ASK for short trades

    Hello,

    i´m using an unmanaged strategy. So far i do the trailstop
    CalculateOnBarClose = true;
    below the low (low[0] - ticksize) and above the high (high[0] + ticksize)
    of an finished candle.

    I now like to test a trailstop
    CalculateOnBarClose = false;
    that trails 1 tick below the current Bid-Price for Long trades and
    1 tick above the current Ask-Price for Short trades.

    Is it possible to access this valued during live trading ?

    Thank you !

    #2
    nt2010, yes it is possible. You can use GetCurrentAsk() and GetCurrentBid() to get those prices. Those methods only work during a real-time test though. During backtesting, they will return the close price of the bar.
    AustinNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    67 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    36 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    60 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    62 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    53 views
    0 likes
    Last Post CarlTrading  
    Working...
    X