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 NullPointStrategies, Today, 05:17 AM
      0 responses
      52 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      130 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      70 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      44 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      48 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X