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)
I'm learning EL currently before I get TS. Does anyone know of some java EL compiler that I can use to check the code I write for my examples?
Another question:
I want to go long at the open of tomorrow is the close of today is higher than the open of today and also higher than the high of yesterday but I want to exit the position at the close. Will this work?
Thanks
Can you help answer these questions from other members on NexusFi?
Timot - I do not think there is a standalone compiler to check EL code. I am not sure that it would be very helpful because the compile errors are usually easy to solve but the logic errors can be much more time consuming.
I checked your code and it does not compile because order execution at the close is restricted to "this bar" only. From your code, I assume that you want to use daily bars. Selling on the close of a daily bar will probably work for backtesting. But I do not code this way because I think that it will not work in real time as the market could be closed. I suggest using bars with a smaller time period and specifying a sell time before the market closes.
I checked your code and it does not compile because order execution at the close is restricted to "this bar" only. From your code, I assume that you want to use daily bars. Selling on the close of a daily bar will probably work for backtesting. But I do not code this way because I think that it will not work in real time as the market could be closed. I suggest using bars with a smaller time period and specifying a sell time before the market closes.
Len
Thanks Len. So if I understand what you say I better use something like this:
if c[0] > h[1] AND c[0] > o[0] then
Buy Next Bar at open;
If marketposition = 1 then
sell this Bar on close;
end;
Will this close the position on the same bar it was opened?
This is only for daily bar back-testing to start with. I'm to much of an amateur to go real-time intraday any time soon.
I'm learning EL currently before I get TS. Does anyone know of some java EL compiler that I can use to check the code I write for my examples?
Another question:
I want to go long at the open of tomorrow is the close of today is higher than the open of today and also higher than the high of yesterday but I want to exit the position at the close. Will this work?
if c[0] > h[1] AND c[0] > o[0] then begin
Buy Next Bar at open;
sell Next Bar at close;
end;
I'm learning EL currently before I get TS. Does anyone know of some java EL compiler that I can use to check the code I write for my examples?
Another question:
I want to go long at the open of tomorrow is the close of today is higher than the open of today and also higher than the high of yesterday but I want to exit the position at the close. Will this work?
if c[0] > h[1] AND c[0] > o[0] then begin
Buy Next Bar at open;
sell Next Bar at close;
end;
Thanks
you cannot sell Next Bar at close
because in real time, you could not know that specific tick is the close until the close has happened.
ie. the best you can do is the sell at the tick AFTER the close, and that would be the open of the following bar.
@Bimi - This is just weird. Both of your comments are incorrect and you should consider deleting them. The chart that I posted demonstrates that Timot's code does what he wants to do with backtesting.
@Bimi - This is just weird. Both of your comments are incorrect and you should consider deleting them. The chart that I posted demonstrates that Timot's code does what he wants to do with backtesting.
Len
In his defense it is sort of correct.
It all depends on how the op wants to trade?
Trying to get the very last tick price of the day would be near to impossible but if you are looking to see if your in the ball park with your system, then the market on close is close enough .
Who knows, maybe the user will sit at his pc and hit the close trade button with seconds to go before the close of the day.
Neil.