My MultiTimeFrame strategy has partitioning of the rules/conditions, and I have been experimenting to better understand the BIP capabilities and the design of the indicators for the best type of bars etc.
Version 1: default/original
#region Region_OnBarUpdate
protected override void OnBarUpdate()
{
if (CurrentBars[0] < 250 || CurrentBars[1] < 250 || CurrentBars[2] < 250)
return;
{
if (BarsInProgress == 0)
#region ENTRY RULES
// all the entry conditions based on BarsArray 0 and 1
/* this is the default setup */
#endregion
#region EXIT RULES
// all the exit conditions based on BarsArray 0 and 1 and 2
/* this is the default setup */
#endregion
#region TRAILING RULES FOR "SETSTOPLOSS()"
// all the trailing rules & conditions based exclusively on BarsArray 0 = the default setup
/* Prints show that BarsArray0 and BarsArray1 and BarsArray2 are all making changes to the stop loss position on each bar close of the respective array. I now understand that is expected */
#endregion
#endregion END OF 'ON BAR UPDATES'
}
}
Version 2:
#region Region_OnBarUpdate
protected override void OnBarUpdate()
{
if (CurrentBars[0] < 250 || CurrentBars[1] < 250 || CurrentBars[2] < 250)
return;
{
if (BarsInProgress != 0)
return;
if (BarsInProgress == 0)
#region ENTRY RULES
// all the entry conditions based on BarsArray 0 and 1
/* 75% fewer trades entered, so I expect that the rules based on BA1 are actually being triggered off BA0, otherwise, since the conditions require BOTH BA0 and BA1 conditions to be met there would be no trades entered */
#endregion
#region EXIT RULES
// all the exit conditions based on BarsArray 0 and 1 and 2
#endregion
#region TRAILING RULES FOR "SETSTOPLOSS()"
// all the trailing rules & conditions based exclusively on BarsArray 0
/* Prints show that BarsArray0 only is making changes to the
stop loss position on each bar close of the respective array. */
#endregion
#endregion END OF 'ON BAR UPDATES'
}
}
Version 3:
#region Region_OnBarUpdate
protected override void OnBarUpdate()
{
if (CurrentBars[0] < 250 || CurrentBars[1] < 250 || CurrentBars[2] < 250)
return;
{
if (BarsInProgress == 0)
#region ENTRY RULES
// all the entry conditions based on BarsArray 0 and 1
/* 10% fewer trades entered (ie trade exits are different from version 1), and sharpe ratio and profit factor are consistent as are drawdown points*/
#endregion
#region EXIT RULES
// all the exit conditions based on BarsArray 0 and 1 and 2
#endregion
#region TRAILING RULES FOR "SETSTOPLOSS()"
{
if (BarsInProgress != 0)
return;
// all the trailing rules & conditions based exclusively on BarsArray 0
/* Prints show that BarsArray0 only is making changes to the
stop loss position on each bar close of the respective array. */
}
#endregion
#endregion END OF 'ON BAR UPDATES'
}
}
What I am wondering is the best way to configure BIP 0 & 1 to restrict data for the ENTRY specific conditions&rules in scenario described above, and if there can be improvements overall.
Thanks,
Jon
Comment