Help with easylanguage entry at open of currentbar

mtorri

Newbie
Messages
7
Likes
0
hi everybody

I've been coding easylanguage for a while but I never found how to do this:

I want to enter long if the OPEN of the current bar is higher then a calculated value (let's say X).
And I want to place a limit order at the open value 1 second after the open.

Using prorealtime I can test this strategy writing

if open > X then
buy 1 shares at open limit realtime


how do I do that in easylanguage?
Please note that I can't use "buy next bar at Open" because I need the open value in order to take the decision.

One could ask me why I don't change the wole system using the close information...
Because in Italy there are often gaps and using the close information I would completely loose the first trading bar after the market open.

Any help?
Thanks
 
You can do the same thing in TS using IntraBarOrderGeneration which will allow you to trade as soon as the next tick on the chart after condition is met.
 
Thank you!

I've read something about this IntrabarOrderGeneration flag.
It's the perfect solution for a realtime simulation of my strategy but...
I would like to backtest the strategy and as far as I understood this flag needs tik by tik data wich I don't have.

So, having only 30min. intraday historical data, there is no way to simulate/backtest a strategy that enters at the open of the currentbar?

Prorealtime does it while easylanguage not?
I can't believe it!
 
Is there a reason you need to do this ?

This is going to give you false results. To process a bar (even if it is just the first tik of the bar) and then put a trade on at the open of that same bar is going to make your results unrealistic. You are purposely backtesting a scenario that is impossible in real life.

As for tik data - you have it going back 6 months only.
 
Hi DionysusToast,

Yes you're right the results of the backtest are a little unrealistic, but just a little.
I do have some slippage but it's affordable.
I'm speaking about a strategy I already manually trade since some months.
I backtested it using prorealtime, but there I only have 3,5 years of intraday data.

Why I want to do that in easylanguage?
- to backtest it using 10 years of data
- to start my (long) process of automation

I do have 5min intraday data, I guess that using the IntrabarOrderGeneration flag I can backtest a strategy that enters 5min later the open (instead 30min later).
is this correct?
 
Does this system use any indicators ?

It is probably the 1 key factor with how you move forward and the answer you seek will be different depending on whether indicators are being used or not.

Also - what is the average amount of time in the trade ? Minutes, hours, days ? This also will make a difference to the approach.
 
I don't understand how these info are useful to find a way to enter at the open.
Anyway:
- yes I do use indicators, and of course I only use the open info of the last bar to calculate them
- average trade is about 3-4 bars (30min)

It is probably the 1 key factor with how you move forward
sorry I don't follow you on this
 
I'm using TS 2000i and the "open of next bar" does exactly what you're looking for (if I got you right!?). I tried this one and it works fine:

if (open of next bar)<Low then buy Low stop;

Just replace the conditions and the order-type...

Did it help?
 
Hi Mike!

After a quick test it seems it works! :clap:

if (open of next bar) > X then buy 1 shares next bar at open stop;

The strange fact is that the following orders do exactly the same thing: enter at the open

if (open of next bar) > X then buy 1 shares next bar at (open+5) stop;
if (open of next bar) > X then buy 1 shares next bar at LOW stop;
if (open of next bar) > X then buy 1 shares next bar at 1000 stop;

anyway I don't care, what I need is entering at the open, so I'm happy.
Thank you very much.
 
hi everybody

I've been coding easylanguage for a while but I never found how to do this:

I want to enter long if the OPEN of the current bar is higher then a calculated value (let's say X).
And I want to place a limit order at the open value 1 second after the open.

Using prorealtime I can test this strategy writing

if open > X then
buy 1 shares at open limit realtime


how do I do that in easylanguage?
Please note that I can't use "buy next bar at Open" because I need the open value in order to take the decision.

One could ask me why I don't change the wole system using the close information...
Because in Italy there are often gaps and using the close information I would completely loose the first trading bar after the market open.

Any help?
Thanks


I remember someone talked about this at the MultiCharts forum
http://forum.tssupport.com/index.php
you have to do a search to find out.
 
there is nothing funnier than watching 2 anonymous strangers pissing at each other

but they don't realized that all they wetted are their own feet.
 
I remember someone talked about this at the MultiCharts forum
http://forum.tssupport.com/index.php
you have to do a search to find out.

Do you mean this one?
http://forum.tssupport.com/viewtopic.php?t=7087

ok I found also this one
http://forum.tssupport.com/viewtopic.php?t=6814

I see the point:
" by the time you figured out the value of var2... the opening tick is GONE. "

The fact is that I know my X level BEFORE the open because I simulate every possible open thorugh some loops.
Thank to this I'm prepared.
If 10 seconds before the end of the current 30min bar the current price is already above my X level I put my order.
Obviously there is some slippage but sometimes is against me and sometimes is in favour.
The only problem is at the market open, there I can have big splippages. But it's affordable, it happens rarely.
And a couple of times I also got big sippages in my favour.

So, since this strange strategy, from my point of view, is tradable, I was searching for a way to backtest it over 10 years using 30min data.

Am I pissing too far?
 
Last edited:
OK - there are some issues with EasyLanguage though. The biggest one is that it pushes you towards the development of certain types of system. For instance, you can't use time & sales data and so can't incorporate that into your system. It's not very good at handling multiple data streams and intra bar orders.

If you only want to use price & volume in your system then I guess it's fine.
 
OK - there are some issues with EasyLanguage though. The biggest one is that it pushes you towards the development of certain types of system. For instance, you can't use time & sales data and so can't incorporate that into your system. It's not very good at handling multiple data streams and intra bar orders.

If you only want to use price & volume in your system then I guess it's fine.


I agree, T&S is missing in EL.

MultiChart handles multi-data, sub-minute and intrabar much better than TradeStation.
With MultiCharts, you can mix time-based data stream (eg. 5min) with non-time-based data stream (eg. tick chart or volume bar chart) in the same chart and within the same indicator or strategy.
 
Top