int profit()
{
if(TradeIsOpen && (TradeProfit/TradeUnits/PIP < -10) && TradeIsShort)
{
exitTrade();
}
if(TradeIsOpen && (TradeProfit/TradeUnits/PIP > 10) && TradeIsShort)
{
exitTrade();
}
return 0;
}
function run()
{
set(LOGFILE,PLOTNOW,TICKS);
Fill = 0; // For the sake of comparison, not realistic otherwise
StartDate = 20191215;
EndDate = 20191220;
BarMode = BR_FLAT; // To handle potential missing M1 data which would screw up time comparisons below...
//BarPeriod=60;
BarPeriod=5;
asset("EUR/USD");
if(hour()==22 && minute()==0)
{
enterShort(profit);
}
if(hour()==06 && minute()==0)
{
exitTrade();
}
}