Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SampleATMstrategy

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

    SampleATMstrategy

    I have tried running the sample ATM strategy in Market Replay and have run into some quirks.

    1. The position and P&L do not show up on the Strategy tab like other strategies do.
    2. I sometimes run a second chart with the chart trader open to view the open trades (entry, stoploss, profit target 'flags') on the chart. This is not behaving consistently with the ATM settings. e.g. the settings are reset once the ATM is called and the ATM settings revert to an earlier setting. Trailing stop, profit targets etc. Also, the flags do not show the proper entry price level and actually move in the middle of a trade?!

    Any suggestions?
    Thanks.

    #2
    Hi Bill, first : it's expected that ATM's are no longer listed anymore in the strategies tab, this is for NinjaScript strategies only.

    The script would change stop / target levels as the trade develops, this is intended for demoing the possiblities of script access to the ATM's.

    Comment


      #3
      OK, I guess I understand. I assumed that I needed to create the SampleAtmTemplate and establish the settings which would then run when the strategy called the atm in the stratetgy. (make sense?). Therefore, when the SampleAtmTemplate was activated, I assumed it would follow the settings I set. I had no stop strategies, just a simple stoploss and yet the stop was constantly moving during the trade, which I would not expect. Is there a problem using an automated strategy that 'calls' an ATM in Market Replay?

      Comment


        #4
        Hi Bill, there's no issue using the sample in Market Replay or using NinjaScripts calling ATM's in Market Replay - there is simply logic in the sample we ship that shows how to modify / trail the ATM stop to the CurrentBar Low - 3 Ticks >> that's what you see happen here.

        if (GetAtmStrategyMarketPosition(atmStrategyId) != MarketPosition.Flat)
        AtmStrategyChangeStopTarget(0, Low[0] - 3 * TickSize, "STOP1", atmStrategyId);

        Comment


          #5
          Oh, ok. I didn't see that stop price change. Just out of curiosity, when you implement a function like this change in the stop 'outside' the ATM, does it present any potential conflict in NT if you change the settings in your ATM to include some of the built-in ATM stop features?

          Thanks.

          Comment


            #6
            You're welcome, yes the could be conflicts as both the template and the code attempts to change orders. You would need to be aware of what you're doing then exactly either via template or code, one way to avoid this is splitting it up - for example use the AutoBreakeven of the template and once triggered move the stop alongside a SMA of the lows via code...

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            83 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            47 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            29 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            32 views
            0 likes
            Last Post TheRealMorford  
            Started by Mindset, 02-28-2026, 06:16 AM
            0 responses
            66 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Working...
            X