bertrandpinoy – Only English in the English speaking forums please.
Ok stopped again with mind set at 60. Trying at 120 now. What is this setting? Stop loss? Asking since it doesn’t change backtest results…
What is this setting? Stop loss? Asking since it doesn’t change backtest results…
Best if you post the snippet where you are making the change so others can check it out.
It is possible that when you / we get rejected we are under the conditions I highlighted in my post below. I was manual trading, but it could equally have been an Auto-Trade.
I couldn’t change my stops!
Rejected again, always at the same hour: 4 a.m.
Another stop this night. @Gubben did you resolved with mindist 120?
Stopped at 120 as well. Trying this now
once limitSLbroker=0
if time >035900 and time<053000 and CurrentDayOfWeek>=0 then
limitSLbroker=272
elsif time>053000 and time<03590 and CurrentDayOfWeek>=0 then
limitSLbroker =10
elsif time>210000 and CurrentDayOfWeek>5 then
limitSLbroker=271
endif
minddist = limitslbroker
PaulParticipant
Master
probably the easiest way to tackle this, is using market orders, 1 minute and mtf. It would clean up the code too!
or split the code.
one code setup for backtesting 1 hour timeframe
one code setup to trade live on 1 minute timeframe for which the trade has to be the same as on the one hour timeframe in the backtest.
Stopped at 120 as well. Trying this now
|
|
once limitSLbroker=0
if time >035900 and time<053000 and CurrentDayOfWeek>=0 then
limitSLbroker=272
elsif time>053000 and time<03590 and CurrentDayOfWeek>=0 then
limitSLbroker =10
elsif time>210000 and CurrentDayOfWeek>5 then
limitSLbroker=271
endif
minddist = limitslbroker
|
As i said in the previous page, removing the 4am trade will make the stategy very less profitable; so it’s not a right solution.
probably the easiest way to tackle this, is using market orders, 1 minute and mtf. It would clean up the code too!
or split the code.
one code setup for backtesting 1 hour timeframe
one code setup to trade live on 1 minute timeframe for which the trade has to be the same as on the one hour timeframe in the backtest.
Is this possible? Never heard about something like this.. looks interesting!
PaulParticipant
Master
have a look
It’s in the details and needs more attention, but this is roughly what I mean.
use mode=1 for one hour timeframe for backtesting
use mode=0 for 1 minute timeframe for demo/live
It will never be 100% the same, 1 hour and 1 minute.
Would this stop it from being rejected repeatedly at 4AM?
PaulParticipant
Master
yes, if running on 1 minute timeframe and with mode=0.
no entry rejections based on minimum stop distance.
Still there can be other reason why a trade is, or is not triggered compared to the backtest 1 hour timeframe.
PaulParticipant
Master
few minor changes
the trailingstop on 1 minute timeframe can cause sometimes differences compared to the 1 hour backtest. Needs more testing.
the file, load on dax 1 hour timeframe
to run in demo, set mode to 0 and use 1 minute chart.
Ok Paul, so if i understood well, when running the strategy live or demo we need to use mode 0.
But the strategy with mode 0 needs to be applied on 1h or 1m chart?
And the results with mode 0 will be the same as the 1h backtested?
To run live, mode=0 on 1 minute chart.
PaulParticipant
Master
And the results with mode 0 will be the same as the 1h backtested?
That’s the goal, but there will always be differences, since the entry price is slightly different between 1 hour and 1 minute.
As result, it could make the difference when a stoploss is triggered or not, same for a trailing stop or profit-level.
But if one has to choose between a flimsy entry because of the minimum stop distance or this, then this is the way to go I think.
So a.t.m. it’s best to test, as Gubben described it and compare it to the backtest 1 hour.