I need assistance debugging a cAlgo program -- $30

C# Indikatoren Sonstiges C#

Auftrag beendet

Ausführungszeit 1 Stunde
Bewertung des Kunden
The developer is very professional. The job was completed in less than 2 hours of being accepted. I would recommend him any-day.

Spezifikation

i converted an MQL5 indicator "Volume Zone Oscillator" to cAlgo. The indicator attaches to the chart and displays but it throws an error " Crashed in Calculate with IndexOutOfRangeException: Index was outside the bounds of the array."; I need assistance with debugging


MQL5 indicator is attached.


The cAlgo indicator is below

///=====================================================


// Importing necessary namespaces

using cAlgo.API;
using System;

namespace cAlgo
{

[Cloud("Upper Level", "Lower Level", FirstColor = "Gainsboro", SecondColor = "Crimson", Opacity = 0.4)]
[Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class VolumeZoneOscillator : Indicator
{
// Declare the indicator buffers
[Output("Upper Level", PlotType = PlotType.Line, LineColor = "Gainsboro")]
public IndicatorDataSeries LevUp { get; set; }

[Output("Lower Level", PlotType = PlotType.Line, LineColor = "Crimson")]
public IndicatorDataSeries LevDn { get; set; }

[Output("Volume Zone Oscillator", PlotType = PlotType.Line, LineColor = "DarkGray")]
public IndicatorDataSeries VZO { get; set; }

[Output("Volume Zone Oscillator Color", PlotType = PlotType.Line, LineColor = "LimeGreen")]
public IndicatorDataSeries VZOC { get; set; }

// Declare input variables
[Parameter("Period", DefaultValue = 14)]
public int Period { get; set; }

// Private variables
private double[,] work;
private double alpha;

// Initialize method
protected override void Initialize()
{
work = new double[Bars.Count, 2];
alpha = 2.0 / (1.0 + Period);
//Chart.Title = "Volume Zone Oscillator (" + Period + ")";
}

// Calculate method - Called for every new bar/candle
public override void Calculate(int index)
{
// Skip if insufficient data
if (index < Period) return;

double sign = 0;
if (index > 0)
{
sign = (Bars.ClosePrices[index] > Bars.ClosePrices[index - 1]) ? 1 : (Bars.ClosePrices[index] < Bars.ClosePrices[index - 1]) ? -1 : 0;
}

double R = sign * Bars.TickVolumes[index];
work[index, 0] = (index == 0) ? R : work[index - 1, 0] + alpha * (R - work[index - 1, 0]);
work[index, 1] = (index == 0) ? Bars.TickVolumes[index] : work[index - 1, 1] + alpha * (Bars.TickVolumes[index] - work[index - 1, 1]);

// Calculate VZO (Volume Zone Oscillator)
if (work[index, 1] != 0)
VZO[index] = 100.0 * work[index, 0] / work[index, 1];
else
VZO[index] = 0;

// Calculate VZOC color (Volume Zone Oscillator Color Index)
VZOC[index] = (VZO[index] > 0) ? 1 : (VZO[index] < 0) ? 2 : 0;

// Calculate LevUp and LevDn (to draw filling)
LevUp[index] = Math.Max(VZO[index], 0);
LevDn[index] = Math.Min(VZO[index], 0);
}
}
}


===================================================================



Bewerbungen

1
Entwickler 1
Bewertung
(1)
Projekte
2
0%
Schlichtung
2
0% / 50%
Frist nicht eingehalten
0
Frei
2
Entwickler 2
Bewertung
(2)
Projekte
3
0%
Schlichtung
8
13% / 88%
Frist nicht eingehalten
1
33%
Frei
3
Entwickler 3
Bewertung
(155)
Projekte
164
43%
Schlichtung
3
33% / 33%
Frist nicht eingehalten
1
1%
Arbeitet
4
Entwickler 4
Bewertung
Projekte
0
0%
Schlichtung
0
Frist nicht eingehalten
0
Frei
5
Entwickler 5
Bewertung
(3)
Projekte
1
0%
Schlichtung
5
0% / 100%
Frist nicht eingehalten
0
Frei
6
Entwickler 6
Bewertung
(3)
Projekte
2
0%
Schlichtung
1
0% / 100%
Frist nicht eingehalten
0
Frei
Ähnliche Aufträge
The bot will follow the price action on the renko chart on ctrader . it will show the high and low levels on live charts . The high and low will only be made if the previous high or low broken . the level that cause the break must have atleast two or more opposite bricks to become a new low or high level if there is only one brick then bot will ignore it and last level will remain same untill the 2 or more cause the
Hello, i would like to have a ninjatrader indicator. I wanna to have a footprint indicator with delta, imbalances and big trades identifiable. Also I wanna sell it on whop. And it should be fully customisable in NT8
I would like to program a ninja trader strategy that involves a Cycle ID indicator. Can you take a look to see if you can program the indicator in a strategy? Let me know if you can do this
Hello, I have a Ctrader indicator with the source code, I was wondering if this possible to convert it to Quantower. Hello, I have a Ctrader indicator with the source code, I was wondering if tis possible to convert it to Quantower., i need an expert who can convert it perfectly
I’m looking for an experienced NinjaTrader developer to complete an existing custom indicator. The project is already partially built and is well organized, completely functional, and well documented. The former developer experienced some personal difficulties and unfortunately cannot continue. Key Requirement (Read Carefully): You MUST have direct, hands-on experience with NinjaTrader and NinjaScript (C#) . This is
Hi i need an expert to built a automated trading bot for ninja trader platform like sniper auto trader bot If you can develop or build automated bot for ninjatrader, let me know
Hello Developers I have a Project to get done! i have a simple strategy can you please create the automated forex ea to execute my trading strategy? i need custom ea for tradingview and mt4/mt5 correction: i need a tradingview indicator created that tells me when to buy or sell. and ea in mt4/mt5
Early Killer EA 30+ USD
It must have automated stop loss. Something that can end poverty and kill the market early.It must take the trades for me whenever I start it it must work on tradeport ea

Projektdetails

Budget
30+ USD
Ausführungsfristen
bis 2 Tag(e)