Hi there,
i'm looking to have this re-coded for mt4 from prorealtime.
Essentially on monday at a preset time for DAX if price is 'x' pips up a long trade is placed. Check out the logic below from PRT, is there anyone who may be able to replicate this in mt4?
// Code-Parameter
DEFPARAM FlatAfter = 095500
// trading window
ONCE BuyTime = 85500
ONCE SellTime = 95500 ONCE
CloseDiff = 50 ONCE
PositionSize = 25
ONCE sl = 50
// Long all in, if it's Monday and the market is 50 points higher
IF Not LongOnMarket AND Time = BuyTime AND (CurrentDayOfWeek = 1) THEN
Diff = close - DClose(1)
IF Diff > CloseDiff THEN
BUY PositionSize CONTRACT AT MARKET
ENDIF
ENDIF
// exit position
IF LongOnMarket AND Time = SellTime THEN
SELL AT MARKET
ENDIF
// stop
SET STOP pLOSS sl
It shouldn't trade all that often, but when it does the conditions typically result in a profit.
i'm looking to have this re-coded for mt4 from prorealtime.
Essentially on monday at a preset time for DAX if price is 'x' pips up a long trade is placed. Check out the logic below from PRT, is there anyone who may be able to replicate this in mt4?
// Code-Parameter
DEFPARAM FlatAfter = 095500
// trading window
ONCE BuyTime = 85500
ONCE SellTime = 95500 ONCE
CloseDiff = 50 ONCE
PositionSize = 25
ONCE sl = 50
// Long all in, if it's Monday and the market is 50 points higher
IF Not LongOnMarket AND Time = BuyTime AND (CurrentDayOfWeek = 1) THEN
Diff = close - DClose(1)
IF Diff > CloseDiff THEN
BUY PositionSize CONTRACT AT MARKET
ENDIF
ENDIF
// exit position
IF LongOnMarket AND Time = SellTime THEN
SELL AT MARKET
ENDIF
// stop
SET STOP pLOSS sl
It shouldn't trade all that often, but when it does the conditions typically result in a profit.