Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

granular resolution error

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

    granular resolution error

    Hallo,

    in strategy builder I am trying to do very simple thing. When price cross above the indicator SWING, enter long position. (but enter not on bar close but enter on intrabar basis = as soon as the price crosses the swing)
    I have been reading the forum about the granular resolution data series issue, adjusted the code as written (I am not programmer), but the problem is still there.
    If i do the historical data backtest, this error still occures: high order fill resolution is only available for single series strategies. For multi-series......

    Could you please review my simple code, I believe for you it is matter of few seconds. Thank you very much. Regards Radomir







    namespace NinjaTrader.NinjaScript.Strategies
    {
    public class swing3 : Strategy
    {
    private Swing Swing1;

    protected override void OnStateChange()
    {
    if (State == State.SetDefaults)
    {
    Description = @"Enter the description for your new custom Strategy here.";
    Name = "swing3";
    Calculate = Calculate.OnEachTick;
    EntriesPerDirection = 1;
    EntryHandling = EntryHandling.AllEntries;
    IsExitOnSessionCloseStrategy = true;
    ExitOnSessionCloseSeconds = 30;
    IsFillLimitOnTouch = false;
    MaximumBarsLookBack = MaximumBarsLookBack.TwoHundredFiftySix;
    OrderFillResolution = OrderFillResolution.High;
    OrderFillResolutionType = BarsPeriodType.Minute;
    OrderFillResolutionValue = 1;
    Slippage = 0;
    StartBehavior = StartBehavior.WaitUntilFlat;
    TimeInForce = TimeInForce.Gtc;
    TraceOrders = false;
    RealtimeErrorHandling = RealtimeErrorHandling.StopCancelClose;
    StopTargetHandling = StopTargetHandling.PerEntryExecution;
    BarsRequiredToTrade = 20;
    // Disable this property for performance gains in Strategy Analyzer optimizations
    // See the Help Guide for additional information
    IsInstantiatedOnEachOptimizationIteration = true;
    }
    else if (State == State.Configure)
    {
    AddDataSeries("NQ 09-19", Data.BarsPeriodType.Tick, 1, Data.MarketDataType.Bid);
    }
    else if (State == State.DataLoaded)
    {
    Swing1 = Swing(Close, 3);
    SetProfitTarget("", CalculationMode.Ticks, 20);
    SetStopLoss("", CalculationMode.Ticks, 20, false);
    }
    }

    protected override void OnBarUpdate()
    {
    if (BarsInProgress == 1)
    return;

    if (CurrentBars[0] < 1)
    return;

    // Set 1
    if (CrossAbove(GetCurrentBid(0), Swing1.SwingHigh, 1))
    {
    EnterLong(Convert.ToInt32(DefaultQuantity), "");
    }

    }
    }
    }

Latest Posts

Collapse

Topics Statistics Last Post
Started by NullPointStrategies, Today, 05:17 AM
0 responses
25 views
0 likes
Last Post NullPointStrategies  
Started by argusthome, 03-08-2026, 10:06 AM
0 responses
121 views
0 likes
Last Post argusthome  
Started by NabilKhattabi, 03-06-2026, 11:18 AM
0 responses
64 views
0 likes
Last Post NabilKhattabi  
Started by Deep42, 03-06-2026, 12:28 AM
0 responses
41 views
0 likes
Last Post Deep42
by Deep42
 
Started by TheRealMorford, 03-05-2026, 06:15 PM
0 responses
46 views
0 likes
Last Post TheRealMorford  
Working...
X