This variable is not used in the code:tradetime”
Did you use TradeTime between an If Then statement?
GraHal,
You are correct, I did not use Tradetime between an If and then statement – thanks for that.
As an aside……………If you create two separate strategies, can they be both used at the same time on one market?, or only one strategy at a time can be used on a that particular market ?
thanking you
can they be both used at the same time on one market?,
Yes 2 separate Strategies can be run at the same time on the same instrument, even at the same Timeframe.
Only problem you may occasionally experience is that if 2 trades on the same instrument in the same direction are attempting to be executed at exactly the same time then 1 trade may be delayed for a few milliseconds. Not much of a hardship I’d say? 🙂
GraHal
Thank you for that. I’m thick LOL and so could not get this strategy to work in one system.
So I have created (with your help) two separate systems, one to go long, and one to go short on a 15 minute time frame for the DAX – very simple.
BUT…..eg- I ran then both live this morning 08.00-12.00 and it made a loss (-48.50) on the long side and a profit (+47.20) on the short side.
Immediately ‘back-testing’ it in the same hours, it made a loss (-26.00) on the long side and a profit (+149.00) on the short side???
Its used in a spread bet account with IG (DAX spread 1.2 and IG take their cut of £1.20) so that is all covered. Trading £1/pip.
…………….am I missing something? I knew that it wouldn’t be perfect re slippage etc but this is a vast difference between trading live and back test.
I have attached both the separate codes……….
I am obviously missing something fundamental here?
// Definition of code parameters
DEFPARAM CumulateOrders = False // Cumulating positions deactivated
// The system will cancel all pending orders and close all positions at 0:00. No new ones will be allowed until after the "FLATBEFORE" time.
DEFPARAM FLATBEFORE = 080000
// Cancel all pending orders and close all positions at the "FLATAFTER" time
DEFPARAM FLATAFTER = 163000
// Enter Long
C1 = CLOSE
C2 = OPEN
C3 = CLOSE>OPEN
IF C1 AND C2 AND C3 THEN
BUY 1 PERPOINT AT MARKET
ENDIF
// Stops and targets
SET STOP pTRAILING 4
// Definition of code parameters
DEFPARAM CumulateOrders = False // Cumulating positions deactivated
// The system will cancel all pending orders and close all positions at 0:00. No new ones will be allowed until after the "FLATBEFORE" time.
DEFPARAM FLATBEFORE = 080000
// Cancel all pending orders and close all positions at the "FLATAFTER" time
DEFPARAM FLATAFTER = 163000
// Enter short
C1 = CLOSE
C2 = OPEN
C3 = CLOSE>OPEN
IF C1 AND C2 AND C3 THEN
SELLSHORT 1 PERPOINT AT MARKET
ENDIF
// Stops and targets
SET STOP pTRAILING 4
……..just dont get it?
Dax 08:00 – 16:30 live results
Live Long -76.20, Live Short +52.00 = -£24.20
Dax 08:00 – 16:30 back test results
Backtest Long +11.00. Backtest short +252.00 = +263.00
See attached results of the long and short back tests………
You sure you have the tick by tick box enabled?
With TS = 4 … I would have expected the only one making any money Long or Short would be IG??
PaulParticipant
Master
@bearbull ptrailing should not be used cause it doesn’t work tick by tick. Better use a hard stoploss & a trailing stop from the forum.
Grahal
Thanks for getting back to me.
So back testing is not reliable then? As the results do not reflect the true market? Yes, activating the tick by tick changes the results……or should I say reduces the results. LOL
Paul,
Thanks for your advice, will search the form for a trailing stop code to use.