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 kinfxhk, 07-14-2026, 09:39 AM
      0 responses
      13 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 07-13-2026, 10:18 AM
      0 responses
      59 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 07-13-2026, 09:50 AM
      0 responses
      41 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 07-13-2026, 07:21 AM
      0 responses
      47 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 07-11-2026, 02:11 AM
      0 responses
      38 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Working...
      X