MergePolicy

View as Markdown

Definition

Determines the merge policy of the bars request.

This property is ONLY applicable to Futures contracts. General information regarding merge policies can be found from the Market Data Configuration section. For an Instruments configured merge policy, please see the MasterInstrument.MergePolicy property.

Property Value

Represents the MergePolicy used for the bars request.

Possible values are:

PropertyDescription
DoNotMergeNo merge policy is applied
MergeBackAdjustedMerge policy is applied between contracts along with rollover offsets
MergeNonBackAdjustedMerge policy is applied between contracts without offsets
UseGlobalSettingsUses the value configured from Tools -> Options -> Market Data
UseDefaultUses the default values configured for the MasterInstrument

Syntax

MergePolicy

Example

1// request the last 365 1 day bars
2BarsRequest useGlobalRequest = new BarsRequest(Instrument.GetInstrument("ES 09-16"), 365);
3useGlobalRequest.BarsPeriod = new BarsPeriod { BarsPeriodType = BarsPeriodType.Day, Value = 1 };
4
5// use the merge policy the user has configured as their global setting
6useGlobalRequest.MergePolicy = MergePolicy.UseGlobalSettings;
7useGlobalRequest.Request(new Action<barsrequest, errorcode,="" string="">((barsRequest, errorCode, errorMessage) =>{
8
9 Print("bars returned=" + barsRequest.Bars.Count);
10
11}));
12
13// dispose of the bars request if we are done with it
14useGlobalRequest.Dispose();