Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Swing() on delta

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

    Swing() on delta

    Hello fine folks!

    I'm considering starting a project that involves using Swing() on cumulative delta.

    Looking at the documentation it looks like what I need to do is create a series for the delta value and then use that as the input parameter using:

    Code:
    Swing([B]ISeries<double> input, int strength[/B]).SwingLowBar(int barsAgo, int instance, int lookBackPeriod)
    It seems like I'd have to settle with using the closing delta value for that bar because it doesn't look like I can specify OHLC as an input to the function.

    I'm happy to do that if trying to get delta OHLC would be a pain.

    Am I looking at this right?

    Just wanted to run this past you fine folks before I invest that precious weekend time into the project.

    Thanks!

    #2
    Hello WalterSkinner,

    Thank you for your post.

    You don't actually need to create a series to hold the delta value, just use the Cumulative Delta indicator (you're correct, you can only select one plot, not the OHLC) when you call the Swing indicator:


    Code:
    private OrderFlowCumulativeDelta OFCD1;
    private Swing Swing1;
    protected override void OnStateChange()
    {
    if (State == State.SetDefaults)
    {
    Description = @"Enter the description for your new custom Strategy here.";
    Name = "MyCustomStrategy5";
    Calculate = Calculate.OnBarClose;
    EntriesPerDirection = 1;
    EntryHandling = EntryHandling.AllEntries;
    IsExitOnSessionCloseStrategy = true;
    ExitOnSessionCloseSeconds = 30;
    IsFillLimitOnTouch = false;
    MaximumBarsLookBack = MaximumBarsLookBack.TwoHundredFiftySix;
    OrderFillResolution = OrderFillResolution.Standard;
    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.DataLoaded)
    {
    OFCD1 = OrderFlowCumulativeDelta(CumulativeDeltaType.BidAs k, CumulativeDeltaPeriod.Session, 0);
    Swing1 = Swing(OFCD1.DeltaClose, 5);
    }
    }
    You can then refer to Swing1 when you want to get swing values based on the Cumulative Delta's Delta Close.

    Please let us know if we may be of further assistance to you.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    633 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    364 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    105 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    567 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    568 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X