Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Access ATM strategy ID

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

    Access ATM strategy ID

    Hi,

    I"m building a Strategy that activates a ATM Strategy
    I'm allowing the Strategy to make 5 trades/ direction

    but I'm having a problem getting the information of these different ATM strategies positions, because as i have programmed it now, I cant't access previous launched ATM strategies


    // Condition set LONG ENTRY
    //--------------------------
    if (EMA(Fast)[0] > EMA(Slow)[0]
    && Close[0] < Open[0] && (longcounter < 5))

    if (orderId.Length == 0 && atmStrategyId.Length == 0
    {
    atmStrategyId = GetAtmStrategyUniqueId();
    orderId = GetAtmStrategyUniqueId();
    AtmStrategyCreate(Action.Buy, OrderType.Market, 0, 0, TimeInForce.Gtc, orderId, "test", atmStrategyId);
    longcounter = longcounter +1
    }


    I need to have atmStrategyId and orderId in this condition to be unique very time the condition is true,
    should be something like
    atmStrategyId1 orderId1
    atmStrategyId2 orderId2
    atmStrategyId3 orderId3
    ...

    So afterwards I can access the different ATM strategies by calling these parameters, and adjust stop and target orders for each separately

    Please advice on how to tackle this problem

    Thank you very much
    Nico

    #2
    Calling the methods to get unique ids' are already unique. You could add a suffix such as "myId1", "myId2" etc... in front of the returned unique ID and store these active ids in some array etc...
    RayNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by mjairg, 07-20-2023, 11:57 PM
    3 responses
    213 views
    1 like
    Last Post PaulMohn  
    Started by TheWhiteDragon, 01-21-2019, 12:44 PM
    4 responses
    544 views
    0 likes
    Last Post PaulMohn  
    Started by GLFX005, Today, 03:23 AM
    0 responses
    3 views
    0 likes
    Last Post GLFX005
    by GLFX005
     
    Started by XXtrader, Yesterday, 11:30 PM
    2 responses
    12 views
    0 likes
    Last Post XXtrader  
    Started by Waxavi, Today, 02:10 AM
    0 responses
    7 views
    0 likes
    Last Post Waxavi
    by Waxavi
     
    Working...
    X