Job finished
Specification
Hi, i need to translate this easy code from PRT to Mql4
DEFPARAM CumulateOrders = False // Max 1 position open (usually 2 orders when not on market, when on market 1 position and 1 order to close)
TIMEFRAME (2 hour, updateonclose) // if possible make it variable
mylongentry = low // if possibile make the number of the candle variable
mylongexit = high[1] // if possibile make the number of the candle variable
myshortentry = high // if possibile make the number of the candle variable
myshortexit = low[2] // if possibile make the number of the candle variable
TIMEFRAME (DEFAULT)
stopluca = 100 // extern variable
Mystarttime = 100000 // extern variable
myendtime = 214500 // extern variable
MyendtimeFriday = 224500 // extern variable
Position = 1.00 // extern variable
LucSpread = 20 // extern variable
// condition to operate
c2 = currenttime >= Mystarttime and currenttime =< myendtime and dayofweek <> 5
c4 = currenttime >= Mystarttime and currenttime =< myendtimefriday and dayofweek = 5
// condition for long entry
IF c2 or c4 THEN
BUY position CONTRACT AT mylongentry-LucSpread*pipsize limit
ENDIF
// condition to close long position
if longonmarket then
sell position contract at mylongexit - LucSpread * pipsize limit
elsif longonmarket and dayofweek = 5 and currenttime = myendtimefriday then
sell position contract at market
endif
// condition to enter short
IF c2 or c4 THEN
SELLSHORT position CONTRACT AT myshortentry+LucSpread*pipsize limit
ENDIF
// condition to close short position
if shortonmarket then
exitshort position contract at myshortexit + LucSpread * pipsize limit
elsif shortonmarket and dayofweek = 5 and currenttime = MyendtimeFriday then
exitshort position contract at market
endif
// stop loss
set stop ploss StopLuca