Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multiple Entries same direction

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

    Multiple Entries same direction

    Hi I'm trying to send these 3 market order long when starting a strategy but only the first one is submitted. Why?
    thanks!


    if (State == State.SetDefaults)
    {
    Description = @"Enter the description for your new custom Strategy here.";
    Name = "StrategiaALESSIO";
    Calculate = Calculate.OnPriceChange;
    EntriesPerDirection = 3;
    EntryHandling = EntryHandling.AllEntries;

    IsExitOnSessionCloseStrategy = false;
    ExitOnSessionCloseSeconds = 30;
    IsFillLimitOnTouch = true;
    MaximumBarsLookBack = MaximumBarsLookBack.Infinite;
    OrderFillResolution = OrderFillResolution.Standard;
    Slippage = 0;
    Calculate = Calculate.OnPriceChange;
    StartBehavior = StartBehavior.AdoptAccountPosition;
    TimeInForce = TimeInForce.Gtc;
    TraceOrders = true;
    RealtimeErrorHandling = RealtimeErrorHandling.StopCancelClose;
    StopTargetHandling = StopTargetHandling.ByStrategyPosition;
    BarsRequiredToTrade = 0;
    // Disable this property for performance gains in Strategy Analyzer optimizations
    // See the Help Guide for additional information
    IsInstantiatedOnEachOptimizationIteration = true;
    }
    else if (State == State.Configure)
    {
    }
    }

    protected override void OnBarUpdate()
    {
    EnterLong(1, "1");
    EnterLong(1, "2");
    EnterLong(1, "3");


    if (BarsInProgress != 0)
    return;



    }

    #2
    Hello AlessioCianini12.

    I tried the sample you provided and see that working on my end. Did you re apply the strategy after changing the EntriesPerDirection?

    I did notice that on the first entry on the chart that the execution was outside of the visible range so I had to rescale the chart slightly to see the second and third executions.

    I look forward to being of further assistance.

    Comment


      #3
      Hi, i solved the issue using if (State == State.Historical) return;
      it was doing the enters also for the previous bars and so i was exceeding the maximum number of bars.
      thank you

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      56 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      133 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      73 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      45 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      49 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X