Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trailing Stop in Strategy.

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

    Trailing Stop in Strategy.

    Hi,
    Short of telling me to go learn C#, is there a way on Strategy Builder to set up a strategy to enter a trade where with every say $200 movement in your direction, the stop adjusts itself?

    Does the "Trailing Stop" even work? I have tried setting Trailing stop at a specified Currency value, say $200; however, the price moves strongly in my direction, but the strategy lets it come all the way back: in other words, the trailing stop seems to have NO EFFECT!! Does this Trailing Stop need to have "On Each Tick" set? The strategy I'm working on is based on the price at the close of each bar.

    This would've been easily accomplished if I could call an ATM strategy from a strategy, but I get the feeling you'll want me to learn ninjascript and C# for that. Right? Or has this been made possible from the Strategy Builder..?

    I've looked at your TrailBuilderExample, which is set to evaluate at each tick. How can I incorporate this into my Strategy when my strategy is based on the price at the close of each bar?

    Thanks.

    RK




    #2
    Hello rasdaka,

    Yes the trailing stop does work, it works based on the scripts calculate setting. An example would be using a 1 minute bars type, each 1 minute the target would get updated. If you need to have it update more frequently you can use OnEachTick in realtime to do that. Historical bars still use OnBarClose.

    You can call ATM's from NinjaScript but that is not a feature of the strategy builder, you would need to manually code that kind of strategy. You can see the sample included with the platform called SampleATMStrategy.

    The TrailBuilderExample works in a similar way to the trailstop in the builder, that is modified based on the calculate setting. If you use OnBarClose you will run into the same situation where the target is updated less frequently. To have it update quickly would require using OnEachTick or OnPriceChange modes.

    The strategy builder can accomplish basic strategy needs but If you need more advanced scripts you will need to learn NinjaScript to execute those ideas. The alternate would be to hire a third party programmer to help you create more complex items.

    Comment


      #3
      Hi NinjaTrader_Jesse,

      I've updated the strategy to call an ATM; however, per the manual, it appears that the Performance Statistics are non-existent for the strategy going forward, if it's going to use ATM..!!! Or is it available somewhere that I'm not looking... Doesn't this have serious implications on Strategy development, and augmentation of the strategies that use ATMs? Are we just expected to eye-estimate the results, and act accordingly..???

      Please advise!

      Thanks.

      RK

      Click image for larger version  Name:	image.png Views:	0 Size:	64.3 KB ID:	1220568​​
      Attached Files
      Last edited by rasdaka; 10-23-2022, 03:15 PM.

      Comment


        #4
        Hello rasdaka,

        Yes that is correct, ATMs are not part of a NinjaScript strategy they are their own strategy so none of the NinjaScript strategy based properties apply. ATM's have their own methods you need to use to poll information from them.


        Doesn't this have serious implications on Strategy development, and augmentation of the strategies that use ATMs?
        No this is intended and how ATM's work, you can manually program a straetgy instead of using ATM's for the most flexibility.

        Are we just expected to eye-estimate the results, and act accordingly..???
        ATM''s are self contained so you generally don't need to do anything with it, you would just activate it using NinjaScript and let it complete.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        56 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        133 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        73 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        45 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        49 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X