Replies

voldemort
30 Aug 2020, 15:23

RE: RE: RE: Example code for quick tip:

firemyst said:

voldemort said:

Only difference is I used Bars instead of MarketSeries. Will give this a go. Thanks :)

that should have been "Bars" and not MarketSeries.

I've updated the code in the example.

If it's still not working, it's something else with your code or what you're doing, so you'll need to post some sample code.

Hey, Thanks very much. I had used index instead of customindex at some locations which was the issue I believe. That solved problem for recent data. But, still it does not match completely. I have uploaded indicator in the scripts:

Btw, are you the same fireMyst from whirlpool?

 


@voldemort

voldemort
30 Aug 2020, 14:36

RE: Example code for quick tip:

firemyst said:

Example code for quick tip:

 public override void Calculate(int index)
        {
            int altIndex = index;

            altIndex = _marketSeries.OpenTimes.GetIndexByTime(Bars.OpenTimes[index]);

            //Reference any values from a different timeframe with the altIndex
            double median = (Bars.HighPrices[altIndex] + Bars.LowPrices[altIndex]) / 2;

	   Result[index] = median;
	}

 

Hope this helps :-)

 

 

Only difference is I used Bars instead of MarketSeries. Will give this a go. Thanks :)


@voldemort