Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SampleAtmStrategy

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

    SampleAtmStrategy

    ATM Strategy Errors
    Hello !

    Attached is a modified version of "SampleAtmStrategy" from NT. I've added a short side also.

    The two errors I keep getting are PHP Code:
    "GetAtmStrategyEntryOrderStatus() method error: Missing orderId parameter"

    and PHP Code:
    "AtmStrategyChangeStopTarget() method error: OrderName " is invalid"

    I even tried commenting out the lines 152-155 and 169-172 to try to isolate the problem to no avail.

    Any help you can offer, please do.

    Best Regards,
    Kirk
    Attached Files

    #2
    Kirk, for the first error please print the orderId's assigned and used to see where an invalid one would be used - for the second error you need to refer to a specifc OrderName like in the sample to change the stop or target value (i.e. first stop 1 called "STOP1", second target "TARGET2").

    BertrandNinjaTrader Customer Service

    Comment


      #3
      So, if I understand right, these are somehow HardCoded?

      I tried using STOP1L and STOP1S and even added variables for string assignment but it still comes up as "invalid". Only when I use STOP1 will it work... Not sure why?

      Code:
      [FONT=Verdana]AtmStrategyChangeStopTarget([COLOR=#0000ff]double[/COLOR] [I]limitPrice[/I], [COLOR=#0000ff]double[/COLOR] [I]stopPrice[/I], [COLOR=#0000ff]string[/COLOR] [I]orderName[/I],[COLOR=#0000ff]string[/COLOR][I] AtmStrategyId[/I])[/FONT]
      Why does the sample in the help guide have "0" for the "limitPrice". Since this returns true if the order is found, please provide a better sample or explanation.

      Also, what would the syntax be for modifying more than 1 contract? Is STOP1 for the first contract and STOP2 is for the other (second) contract that is still part of the original order? I see both names popping up in the log files.

      Thanks,

      Kirk
      Last edited by zeller4; 07-08-2010, 05:54 PM.

      Comment


        #4
        Kirk, correct you access the hardcoded names in your ATM template, STOP1 is the first target stop, STOP2 the second one and so on, same goes for TARGET1, TARGET 2 etc.

        The example in the helpguide changes the STOP1 order to the SMA value, there's no limit order at play as auch it's just 0.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          STOP1 vs TARGET1

          Just making sure I have this right:

          assume I have a ATM strategy that enters 3 long trades-each with the same stop loss but with three different profit Targets...would the proper syntax for changing these be:

          To change the stoploss:

          AtmStrategyChangeStopTarget(0, Low[0] - 3 * TickSize, "STOP1", atmStrategyId);

          (would there be 3 stops, one for each corresponding profit target?--> if yes, then I'd use STOP1, STOP2, STOP3?

          to change one or all 3 of the profit targets, would I use this?:

          AtmStrategyChangeStopTarget(0, BE_Price, "TARGET1", atmStrategyId);

          and again for TARGET2 and again for TARGET3?

          where break even price is entry price for each order....

          One last question...I assume we can only have 3 profit targets for one order? like we can in ATM mode?
          Jim-Boulder
          NinjaTrader Ecosystem Vendor - Elephant Tracks

          Comment


            #6
            Correct, this relates to which ATM strategy template you're using in the AtmStrategyCreate() call, if you use one that offer 3 different targets, please refer to each Stop and Target by STOP1, STOP2, STOP3 or TARGET1, TARGET2, TARGET3.

            The maximum would be 3 individual targets, same as the ATM templates would offer.
            BertrandNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by mmenigma, Today, 02:22 PM
            1 response
            3 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by frankthearm, Today, 09:08 AM
            9 responses
            35 views
            0 likes
            Last Post NinjaTrader_Clayton  
            Started by NRITV, Today, 01:15 PM
            2 responses
            9 views
            0 likes
            Last Post NRITV
            by NRITV
             
            Started by maybeimnotrader, Yesterday, 05:46 PM
            5 responses
            26 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by quantismo, Yesterday, 05:13 PM
            2 responses
            21 views
            0 likes
            Last Post quantismo  
            Working...
            X