Hello everyone, I'm a beginner in coding and currently working on creating a time loop in EasyLanguage. I've included the code below, but I'm encountering an error on line 22 (MinuteOfHour).
If anyone can provide assistance with this issue, I would greatly appreciate it.
Inputs:
LinePriceGreen(500.00), // New variable for Long entry
LinePriceRed(300.00), // New variable for Short entry
Tick2(.50);
Variables:
BarBackNo(0),
LongPrice(0),
ShortPrice(0),
BuyCondition(false),
ShortCondition(false),
CurrentTime(0);
For BarBackNo = 0 To 9
Begin
LongPrice = Close;
ShortPrice = Close;
// Check if the minute part of the time is divisible by 5
CurrentTime = Time[BarBackNo];
if MinuteOfHour(CurrentTime) mod 5 = 0 then // Check if time is divisible by 5
Begin
// Buy condition
if LongPrice - LinePriceGreen > Tick2 then
BuyCondition = true;
// Sell Short condition
if ShortPrice - LinePriceRed > Tick2 then
ShortCondition = true;
End;
End;
// Place orders outside the loop based on conditions
if BuyCondition then
Buy next bar at market;
if ShortCondition then
Sell Short next bar at market;
If anyone can provide assistance with this issue, I would greatly appreciate it.
Inputs:
LinePriceGreen(500.00), // New variable for Long entry
LinePriceRed(300.00), // New variable for Short entry
Tick2(.50);
Variables:
BarBackNo(0),
LongPrice(0),
ShortPrice(0),
BuyCondition(false),
ShortCondition(false),
CurrentTime(0);
For BarBackNo = 0 To 9
Begin
LongPrice = Close;
ShortPrice = Close;
// Check if the minute part of the time is divisible by 5
CurrentTime = Time[BarBackNo];
if MinuteOfHour(CurrentTime) mod 5 = 0 then // Check if time is divisible by 5
Begin
// Buy condition
if LongPrice - LinePriceGreen > Tick2 then
BuyCondition = true;
// Sell Short condition
if ShortPrice - LinePriceRed > Tick2 then
ShortCondition = true;
End;
End;
// Place orders outside the loop based on conditions
if BuyCondition then
Buy next bar at market;
if ShortCondition then
Sell Short next bar at market;