Hello guys!
First of all im sorry if there is a thread of this topic. If there is could you please link it? I cant find the search option.
Now to my question:
I would love if someone can help me to write a backtest code for example buy gbpjpy 12:00 and close at 15:00
more specific:
Monday-friday: buy @ 12:00 – sell position @ 15:00
I hope you guys could spare a minute or two to help me out.
Many thanks in advance!
Sorry forgot to add my “code”, please bare with me im pretty new to this 🙂
if time = 110000 then
sell 1 lot at market
endif
if time = 14000 EXITSHORT AT MARKET // I get error at this line, anyone got any idea?
endif
hi,
please time the exit time with the right numbers. one zero is missing
then
you forgot to type “then” before exishort
To buy you have to use BUY, not sell. Exitshort is to exit short trades, to exit Long trades you have to use SELL, instead.
Correct IF…ENDIF form is:
if time=140000 THEN
EXITSHORT AT MARKET //this line must be separate from the others
endif
CharlieByrd – Please use the ‘Insert PRT Code’ button when putting code in your future posts as it makes it far easier for others to read and understand any code posted in the forums.
I have tidied up your post for you 🙂
Hello guys,
First of all sorry for not having the post tidied up Vonasi, lesson learned 🙂 Thanks!
Im at work at the moment but i will try this later and comeback later with the result.
Also i forgot to mention i want to backtest this in both short and long, but i think i got some clues from you guys!
Thank you so much for answering me and helping out, im trying my best to learn this.
/Charlie