Step 1: if stochastics D is < 70 in the lower time frame
&& Stochastics K crossabove stochastics D in lower time frame
&& Stochastics K > Stochastics D in longer time frame
enter long
I've used the multitimeframe example provided by NT, but it keeps complaining everytime that I try to save that it is missing ) on step 1 above and ; on the other lines. I guess I'm not quite sure where the BarsArray[1] fits in the code below.
Any help is appreciated.
Here is my code:
protected override void Initialize()
{
Add(PeriodType.Minute, 1);
Add(PeriodType.Minute, 5);
CalculateOnBarClose = true;
}
protected override void OnBarUpdate()
{
if (BarsInProgress != 0)
return;
if ((Stochastics(BarsArray[1],3, 8, 3).D[0] < 70)
&& CrossAbove(BarsArray[1],Stochastics(3, 8, 3).K, Stochastics(3, 8, 3).D, 1)
&& (Stochastics(BarsArray[2],3, 8, 3).K[0] > Stochastics(3, 8, 3).D[0]))
{
EnterLong(DefaultQuantity, "Long1");
}
}
Comment