Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Here is an updated easier code that I finally figured out.
If marketposition=0 then begin
If month(date) <> month(date[4])
and month(date) = month(date[3])
then sell short next bar at market;
end;
If barssinceentry>=2 and close>close[1] then buytocover next bar at market;
If marketposition=0 then begin
If month(date) <> month(date[19])
and month(date) = month(date[18])
then buy next bar at market;
end;
If barssinceentry>=2 and close<close[1] then sell next bar at market;
Does anyone have any other ways to do this? i.e DayOfMonth function? maybe sellshort next bar after the 10th calendar day of each month? It seems there is no way else to do this but I am open to other ideas. Thank you Kevin and ABC for your help. Your guys really are the real deal.
there is usually more than one way to accomplish something, but your approach appears to be perfectly fine. Besides that its simplicity has some elegance to it, too.
When you start working with DayOfMonth you will have to deal with holidays or weekends as the desired day of the month might not be a trading day.