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.
    BertrandNinjaTrader Customer Service

    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);
        BertrandNinjaTrader Customer Service

        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...
            BertrandNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by bortz, 11-06-2023, 08:04 AM
            47 responses
            1,607 views
            0 likes
            Last Post aligator  
            Started by jaybedreamin, Today, 05:56 PM
            0 responses
            9 views
            0 likes
            Last Post jaybedreamin  
            Started by DJ888, 04-16-2024, 06:09 PM
            6 responses
            19 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by Jon17, Today, 04:33 PM
            0 responses
            6 views
            0 likes
            Last Post Jon17
            by Jon17
             
            Started by Javierw.ok, Today, 04:12 PM
            0 responses
            15 views
            0 likes
            Last Post Javierw.ok  
            Working...
            X