Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Wildcard use for STOP1, STOP2, STOP3, etc

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

    Wildcard use for STOP1, STOP2, STOP3, etc

    I have a strategy that uses an ATM strategy for order entry/control. I have the stops move to the high/low of previous candles. The dilemma i have is, if there are multiple targets, there are multiple orderID's for the stops e.g. STOP1, STOP2, STOP3, etc. I have it working with the code below, but I'm wondering if there is a "cleaner" way for referencing all the orderID's. Potentially, someone could use many targets and I can't really plan for that. Thanks

    if (atmStrategyId.Length > 0)
    {
    // Change the stop price
    if (GetAtmStrategyMarketPosition(atmStrategyId) == MarketPosition.Long && StopStatus == 0)
    {
    AtmStrategyChangeStopTarget(0, LowestLow - 3 * TickSize, "STOP1", atmStrategyId);
    AtmStrategyChangeStopTarget(0, LowestLow - 3 * TickSize, "STOP2", atmStrategyId);
    AtmStrategyChangeStopTarget(0, LowestLow - 3 * TickSize, "STOP3", atmStrategyId);
    AtmStrategyChangeStopTarget(0, LowestLow - 3 * TickSize, "STOP4", atmStrategyId);
    AtmStrategyChangeStopTarget(0, LowestLow - 3 * TickSize, "STOP5", atmStrategyId);
    AtmStrategyChangeStopTarget(0, LowestLow - 3 * TickSize, "STOP6", atmStrategyId);
    StopStatus = 1;
    }

    if (GetAtmStrategyMarketPosition(atmStrategyId) == MarketPosition.Short && StopStatus == 0)
    {
    AtmStrategyChangeStopTarget(0, HighestHigh + 3 * TickSize, "STOP1", atmStrategyId);
    AtmStrategyChangeStopTarget(0, HighestHigh + 3 * TickSize, "STOP2", atmStrategyId);
    AtmStrategyChangeStopTarget(0, HighestHigh + 3 * TickSize, "STOP3", atmStrategyId);
    AtmStrategyChangeStopTarget(0, HighestHigh + 3 * TickSize, "STOP4", atmStrategyId);
    AtmStrategyChangeStopTarget(0, HighestHigh + 3 * TickSize, "STOP5", atmStrategyId);
    AtmStrategyChangeStopTarget(0, HighestHigh + 3 * TickSize, "STOP6", atmStrategyId);
    StopStatus = 1;
    }

    }​

    #2
    Hello mlarocco,

    There is not any kind of wildcard for the names of the orders, you would need to specify then ame like you have done. That would be the only way I could recommend to access specific targets in the ATM or to use their name directly.

    Comment


      #3
      I was afraid of that.... Thanks

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      90 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      137 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      120 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      69 views
      0 likes
      Last Post PaulMohn  
      Working...
      X