Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

continual trade but stop when and if a stop limit order happens

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

    continual trade but stop when and if a stop limit order happens

    i have in my strategy a AllowEntry bool so a trade doesn't keep happening after it reaches profit target (or, stop loss) in the same bar. But, I'd like it to keep trading actually. i found it useful when i was profitable on large candle movements. but, horrible on stop losses if it was a big candle movement in the wrong direction and kept entering and the would get another stop loss. is there a way to have a bool that okays the trade to keep happening if its profitable but doesn't if its not (that includes my profit trigger / profit captures partially to desired profit acquisition)?

    #2
    Hello SteveReiza,

    Thanks for your post.

    The SystemPerformance collection could be used to get the performance of the last trade made. If the last trade made has a negative ProfitCurrency value then you could set the bool to true to stop trades from being placed.

    If the last trade made has a positive ProfitCurrency value and the price is moving in your favor then you could keep the bool set to false and trades would continue to be placed.

    For example, you your last trade was long, you could detect if the price is moving in your favor by checking if the current Close price (Close[0]) is greater than the previous Close price (Close[1]).

    See the help guide documentation for more information and sample code.

    SystemPerformance: https://ninjatrader.com/support/help...erformance.htm
    TradeCollection: https://ninjatrader.com/support/help...collection.htm
    Trade: https://ninjatrader.com/support/help.../nt8/trade.htm
    TradesPerformance: https://ninjatrader.com/support/help...erformance.htm
    TradesPerformanceValues: https://ninjatrader.com/support/help...ancevalues.htm
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Today, 05:17 AM
    0 responses
    48 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    126 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    66 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    42 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    46 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X