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)
a simple question: I would like to buy/sell not on the day closing, as like: "buy/sell this bar on close" but i want to buy/sell after 3 days. It is possibile? how can i write the code to do this?
Normally i used barssinceentry to exit from my position, for example: "if barssinceentry=exit then buytocover this bar on close", how can i enter in position with a delay of 3 days? Is it possible with "barssinceentry"?
depending on what exactly you want to accomplish you can also use a counter and count the number of days since your entry condition was present within your code. Then when the counter reaches 3 (or what ever threshold) you sent the order. Otherwise what I replied here might work, when you want to actually send the order and keep it on the Tradestation servers:
Hello, i think i've solved my problem (t+3) by structuring the condition to buy/sell 3 days before the trade. I have to enter in position only the friday of all the week, so i decided to check the signal for entry 3 days before, but now i have another problem... how can i enter in position all the friday of the week? Is there a function that allow this ? i tried with "dayofweek" but it's not the correct solution..
I wish that all the friday the system give me the order. If i use "DayofWeek" like this: " condition9= dayofweek(currentdate)=friday; " i don't know why but it doesn't work correctly. It enter in position when he wants.
it's hard to tell without knowing your code, but when you use currentdate in your check you will use today's date.
If you run the code on a Friday your condition will be true on every bar, regardless of the date of this bar.
You should use Date instead in the check if you want to use the bar's date instead.