Hi,
just to be sure because in this case I have no livetrading experience:
Example:
I have a long position
timeframe 1 hour
trading hours 080000 to 220000 (you know that IG offers longer trading hours but I don´t like to use them)
Then the signal to sell the position comes with the last candle of the day (210000 until 220000).
In Backtest the position is closed at 080000 next day.
Is this in livetrading the same? German support of Prorealtime says, yes. Is it true? Has anyone livetrading experience with such a situation?
Thanx in advance,
Soma
Hi Soma.
The code you are describing is not clearly to me, without the code.
Perhaps what you are looking for is the DEFPARAM. here are an example.
Cheers Kasper
//====NO Position open between 23:00-07:00
defparam flatbefore=070000
defparam flatafter=230000
//=====================================
//====No trade bewteen these hours
IF (Time >= 080000 AND Time <= 220000) then
Tradetime=1
else
Tradetime=0
endif
//==========================
IF condition and tradetime then
BUY PositionSize CONTRACTS AT MARKET
ENDIF
it´s not the defparam.
Example:
Lets say I have a long position and will sell with.
if longonmarket and close crosses over average[200] then
sell at market
endif
Trading hours 080000 to 220000
The signal comes at 220000
The Backtest sells at 080000 next day.
But when will the live system sell.
080000 next day, too? Or after 220000 because IG has longer trading hours live?
Thank you.
Just test if hour of crossover is not the last hour of trading hours. If it is true, don’t allow trade and wait for the next signal.
Hi Nicolas,
I already do this in all of my live systems. Just wanted to be sure. I will test it with a small position in the next time and will let you know.