Easy Language Date/Time

TraderJoe9292

Newbie
Messages
1
Likes
0
Hello Everyone!

Can someone point me in the right direction or help me with the code for the following trading strategy I want to develop.

How can I write the code for Entering at the open on a specefic date of a commodity then exiting on the close. Then test the performance of that trade for the last 10 years. For example, how could I back test if you bought the market on every March 3rd at the open then sold at the close of the Market on March 3rd for the last 10 years. Any assistance would be appreciated! Thank you!

TraderJoe
 
inputs:
TradeMonth ( 3 ) ,
TradeDay ( 3 ) ,
TradeDir ( 1 ) ;

if month( date next bar ) = TradeMonth and DayOfMonth( date next bar ) = TradeDay then
begin
if TradeDir = 1 then
Buy next bar market
else
SellShort next bar market ;
end ;

SetExitOnClose ;
 
Top