This does not generate any trades. Can't see error in logic.
I need help.
Here is my code
Code: Select all
{Takeoff of TRO Trillion Dollar Forex strategy. Goes long or short when the prior day mid point is broken.
broken}
Input: iMaxDollarLoss(300),
iTarget(125),
Stime (0630),
ETime (1315),
MaxTradesPerDay(1);
vars: pMidpoint(0), MaxTrades (0);
Condition1 = EntriesToday (Date) < MaxTradesPerDay; // limit max trades per day.
pMidpoint = (HighD (1) + LowD (1)) * .50; //Previoue day midpoint
if currentbar > 1 and time = STime and Condition1 then begin
If high > pMidpoint then Buy next bar at market; // enter buy at the previous midpoint
end;
if currentbar > 1 and time = STime and Condition1 then begin
If low = pMidpoint then SellShort next bar at market; // enter sell at the previous day's midpoint
end;
SetStopPosition;
SetProfitTarget (iTarget);
SetStopLoss (iMaxDollarLoss);
SetExitOnClose;
[schild=6 fontcolor=000000 shadowcolor=C0C0C0 shieldshadow=1]I need help[/schild]