GetBarOffset (int displayIndex)
method
price index for a query of Historical data displayIndex = [0, VisibleBarsCount - 1] -1 If the bar is no such index (a hole or out of bounds)
Syntax
public int GetBarOffset (int displayIndex)
Parameters
displayIndex — int
Return
int
Example
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using PTLRuntime.NETScript;
using PTLRuntime.NETScript.Charts;
namespace GetBarOffsetExamples
{
public class GetBarOffsetExamples : NETStrategy
{
public override void OnQuote()
{
int bar_off = CurrentChart.GetBarOffset(1);
Print(bar_off);
Instrument inst = Instruments.Current;
BarData Bars = GetHistoricalData(new HistoricalDataRequest(inst,Period.Day)) as BarData;
Print(Bars.Close(bar_off));
}
}
}
Discussion
Join PTMC community to post your comments
No comments yet. Be the first.