NexusFi: Find Your Edge


Home Menu

 





Learning EL. Question


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one Timot with 3 posts (1 thanks)
    2. looks_two Lampert with 3 posts (4 thanks)
    3. looks_3 Nicolas11 with 3 posts (5 thanks)
    4. looks_4 Bimi with 2 posts (2 thanks)
      Best Posters
    1. looks_one Nicolas11 with 1.7 thanks per post
    2. looks_two Lampert with 1.3 thanks per post
    3. looks_3 NW27 with 1 thanks per post
    4. looks_4 Bimi with 1 thanks per post
    1. trending_up 4,939 views
    2. thumb_up 14 thanks given
    3. group 4 followers
    1. forum 13 posts
    2. attach_file 1 attachments




 
Search this Thread

Learning EL. Question

(login for full post details)
  #1 (permalink)
 Timot 
London
 
Posts: 26 since May 2011

Hello-

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?

 
Code
if c[0] > h[1]  AND c[0] > o[0]  then begin
Buy Next Bar at open;
sell Next Bar at close;
end;
Thanks

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ISO Equity Curve Indicator
NinjaTrader
SPY ETF Question
Stocks and ETFs
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
Request for MACD with option to use different MAs for fa …
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Supertradersams Thread Journal on NQ/MNQ
27 thanks
GFIs1 1 DAX trade per day journal
22 thanks
Diary of a simple price action trader
17 thanks
Daytrading ES & NQ
14 thanks
Tao te Trade: way of the WLD
13 thanks

(login for full post details)
  #3 (permalink)
 
Lampert's Avatar
 Lampert 
Calgary, Canada
 
Experience: Intermediate
Platform: Multicharts
Broker: IB, IQFeed
Trading: GC
Posts: 76 since Nov 2011
Thanks Given: 73
Thanks Received: 142



Timot View Post
Hello-

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?

 
Code
if c[0] > h[1]  AND c[0] > o[0]  then begin
Buy Next Bar at open;
sell Next Bar at close;
end;
Thanks

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.

Len

Reply With Quote
The following 2 users say Thank You to Lampert for this post:
(login for full post details)
  #4 (permalink)
 Timot 
London
 
Posts: 26 since May 2011


Lampert View Post
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:

 
Code
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.

Reply With Quote
(login for full post details)
  #5 (permalink)
 
Lampert's Avatar
 Lampert 
Calgary, Canada
 
Experience: Intermediate
Platform: Multicharts
Broker: IB, IQFeed
Trading: GC
Posts: 76 since Nov 2011
Thanks Given: 73
Thanks Received: 142


Timot View Post
Thanks Len. So if I understand what you say I better use something like this:

 
Code
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.

Timot - Very nice. Just remove the end because there is no begin. See chart below.

Personally, I avoid the use of marketposition because I have had real-time problems (I don't know why). But if I recall, it works fine in backtesting.

Len

PS - If this is helpful, please click on the Thanks button.


Reply With Quote
The following user says Thank You to Lampert for this post:
(login for full post details)
  #6 (permalink)
Bimi
London
 
Posts: 118 since Mar 2010
Thanks Given: 42
Thanks Received: 58


Timot View Post
Hello-

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?

 
Code
if c[0] > h[1]  AND c[0] > o[0]  then begin
Buy Next Bar at open;
sell Next Bar at close;
end;
Thanks

 
Code
Buy Next Bar at open;
should be written as

 
Code
Buy ("B1") Next Bar at market;

Reply With Quote
(login for full post details)
  #7 (permalink)
Bimi
London
 
Posts: 118 since Mar 2010
Thanks Given: 42
Thanks Received: 58


Timot View Post
Hello-

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?

 
Code
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.

Reply With Quote
(login for full post details)
  #8 (permalink)
 
Lampert's Avatar
 Lampert 
Calgary, Canada
 
Experience: Intermediate
Platform: Multicharts
Broker: IB, IQFeed
Trading: GC
Posts: 76 since Nov 2011
Thanks Given: 73
Thanks Received: 142

@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

Reply With Quote
The following user says Thank You to Lampert for this post:
(login for full post details)
  #9 (permalink)
 
Nicolas11's Avatar
 Nicolas11 
near Paris, France
 
Experience: Beginner
Platform: -
Trading: -
Posts: 1,071 since Aug 2011
Thanks Given: 2,232
Thanks Received: 1,769

Hi @Timot,


Timot View Post
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?

MultiCharts also uses Easy Language (it is named Power Language but it is basically the same).

You can download and use MultiCharts free version to test whatever EL code you wish.

Nicolas

Envoyé depuis mon GT-I9100 avec Tapatalk

Visit my NexusFi Trade Journal Reply With Quote
The following user says Thank You to Nicolas11 for this post:
(login for full post details)
  #10 (permalink)
 NW27 
Newcastle, Australia
 
Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker: IB
Trading: SPI,FTSE100, 6E, 6A
Posts: 285 since Oct 2010
Thanks Given: 108
Thanks Received: 188



Lampert View Post
@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.

Reply With Quote
The following user says Thank You to NW27 for this post:





Last Updated on May 12, 2012


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts