Questions and Discussion About Manual Entry Automation

Progster's MEA Package for TradeStation - Enter manually, exit automatically!
User avatar
progster
Posts: 948
Joined: Thu Jul 26, 2007 7:20 pm
Contact:

Questions and Discussion About Manual Entry Automation

Postby progster » Wed Oct 03, 2007 5:49 pm

This topic is for questions and comments about the Manual Entry Automation package.
User's helping users, CodeForTraders helping users, it's all good!
Please stay on-topic, use an informative and accurate subject line, and respect the editorial policies of this Forum. Thanks!

User avatar
progster
Posts: 948
Joined: Thu Jul 26, 2007 7:20 pm
Contact:

MEA Tutorial Videos

Postby progster » Wed Oct 03, 2007 5:50 pm

To learn more about the MEA Package in a dynamic way, you may view the following videos:

MEA Basic Entry and Exit

Using MEA for Manual Exit after Automated Entry

Enjoy!

User avatar
progster
Posts: 948
Joined: Thu Jul 26, 2007 7:20 pm
Contact:

Postby progster » Wed Dec 19, 2007 8:22 pm

A trader inquired by email:

MEA is presented as a live trading tool, which is great, but what I’m looking for now is the ability to backtest my historical entries. Will this package allow me to do that?

My answer (as of 12/19/2007):

The current version of the MEA Package is indeed designed for live trading. Visualization of historical manually-entered trades (i.e. after you have shut down TS and reopened it) is not part of today's basic MEA package.

However, I do have technology for applying to a chart a set of historical entries (such as you might have previously arranged to have written to a log file by MEA itself, or by other means). This specific technology has not been formally "productized" yet.

This is actually a fairly complex bit of code to write.

What it does is read a text file like this one:

symbol,date,time,price,direction,size,type
ER2H06,1051227,939,691.6,-1,-1,1
ER2H06,1051227,941,691.3,1,1,1
ER2H06,1051227,942,691.7,-1,-1,1
ER2H06,1051227,942,691.5,1,1,1

and puts the trades on the chart. You are then able to observe these "logfile" trades in a Performance Report and on the chart itself. In fact, if you have a list of your brokerage trades from the broker you used before TS, you can put them in the format above and use TS to run the performance analysis even on your pre-TS trades!

The trader then replied:

An improvement would be to include a field for entry names, too (e.g. "Crossover" or "LE4") so it would be easier to identify on the chart.

I agree, of course, that that such labelling of historical trades would be desirable.
However, TradeStation does not support this in the way one would wish.

When you say, for example:

Buy ("XO4") next bar at market;

and see "XO4" on the chart with the order, that is based on the string literal "XO4" being present in the actual line of code that you see above. "XO4" is hard-coded, and you cannot use a variable in it's place.

Hence, loading in entry names from a file cannot be made to work in the way one might wish/expect. It's a relatively minor limitation, but certainly we can hope that it will be removed in the future.

The Enhancement Poll for this issue in the TS Forums is found here.

User avatar
progster
Posts: 948
Joined: Thu Jul 26, 2007 7:20 pm
Contact:

Refresh and Kill Buttons

Postby progster » Wed Jan 30, 2008 4:57 pm

The question was submitted via email:

What are the refresh and kill buttons for?

GV_Entry_Stop.png
MEA Dialog with Refresh and Kill Buttons
GV_Entry_Stop.png (8.43 KiB) Viewed 9535 times

Refresh

Updates the Symbol and Shares fields according to certain global variables in the TS environment. Typically, the indicator ‘GV_SetFocus’ is in charge of writing the values into the TS globals. The user should manually cause ‘GV_SetFocus’ to run in the TS environment when they navigate from workspace to workspace. Refresh brings into the dialog whatever the last settings were as made in the TS environment.

Kill

Cancels pending limit and stop orders. Until a signaled limit or stop order is filled, the Listener strategy must renew that order on every bar. Clicking the Kill button signals the Listener strategy to stop performing such renewals, thus “killing” the pending order.

User avatar
progster
Posts: 948
Joined: Thu Jul 26, 2007 7:20 pm
Contact:

Action "right away"?

Postby progster » Wed Jan 30, 2008 5:15 pm

The question was submitted via email (paraphrased):

Does MEA act only on the next bar, or "right away"?

The Listener strategy is meant to be applied to a 1 tick chart. This assures the fastest possible action after you signal a desired order with one of the entry apps.

The Listener strategy, like all TradeStation strategies, gets executed at the close of every bar on the chart it is applied to. Hence, if you apply it to a 1 tick bar chart, you will execute the Listener on every tick of your symbol.

Note carefully: the Listener doesn’t execute until the symbol ticks. Thus YOUR ORDER IS NOT SENT IMMEDIATELY TO THE MARKET (as the Order Bar would send it), but is SENT UPON THE NEXT TICK.

So, the Listener is like any other normal (i.e. non-IntraBarOrderGeneration) automated strategy that you run – it only executes upon bar closures.

This is all normal and natural for a TradeStation strategy. It is just important that you understand that if your symbol isn’t ticking, your signaled order won’t get sent until it does.

So, as a matter of terminology, you are manually “signaling” an order, but not manually “placing:” an order.

User avatar
progster
Posts: 948
Joined: Thu Jul 26, 2007 7:20 pm
Contact:

MEA Package Architecture

Postby progster » Wed Jan 30, 2008 8:59 pm

Here is high-level diagram of the MEA architecture:

MEA_Architecture.jpg
MEA Architecture

The 3 top boxes represent the 3 MEA dialogs:

GV_Entry_Market.gif
GV_Entry_Market.gif (7.39 KiB) Viewed 9536 times
GV_Entry_Limit.gif
GV_Entry_Limit.gif (7.72 KiB) Viewed 9536 times
GV_Entry_Stop.gif
GV_Entry_Stop.gif (7.6 KiB) Viewed 9536 times

These are separate mini-applications, invoked from TradeStation using Macros and HotKeys.

As can be seen, a chart will generally contain the MEA "listener" strategy (e.g. GV_Entry_02), and one or more exit strategies.

Because the listener and the exit strategies are running on the same chart, they have the same understanding of your market position and will interact appropriately.

___

It is possible for entry and exit strategies to be applied to different charts (in the case of futures) and operate together, but to do so requires custom coding for the strategies to be aware of each others actions. There is nothing to prevent you (or your programmer) from setting up any cross-chart interaction you can imagine, but you need to be aware that custom code is necessary to do it.

By enhancing the listener source code (which you get in the MEA package) you could write any state information you desire into global memory, and then you can code exit strategies which read that global memory to determine your current market position from any other chart you wish.

Or, you can keep it simple by having the listener and the exits run on the same chart. This simple approach works great for 'Stops & Targets' and similar profit/loss based exits in all cases. This is how MEA is designed to work immediately, "right out-of-the-box".

TradeStation automation is a complex subject. The best information is found throughout the TradeStation forums, and the community there can usually answer any well-formed question in short order.

Please be aware that I (Progster) cannot provide personal, free consultation on TS Automation in general.
(I'm just too busy with trading, product development, and paying professional work to do so, sorry.)

I will, however, do my best to answer MEA-specific questions here in this area.
Feel free to post your questions, or email them to: questions@CodeForTraders.com

User avatar
progster
Posts: 948
Joined: Thu Jul 26, 2007 7:20 pm
Contact:

Check Your Position Limits!

Postby progster » Thu Feb 28, 2008 3:52 pm

Don't overlook the effect of the Position Limits setting !

If you observe that MEA enters with some number of shares/contracts other than what the dialogs show, or fails to enter, the reason is almost always that Position Limits have altered your order.

Position_Limits.png
Automated Strategy Position Limits

For example, with settings as shown in the picture above, you will not be able to enter more than 100 shares !

Remember, your MEA entry is an automated entry (even though you signaled it manually), and hence all automation settings apply.

User avatar
progster
Posts: 948
Joined: Thu Jul 26, 2007 7:20 pm
Contact:

MEA: General Things to Keep in Mind

Postby progster » Thu Mar 06, 2008 2:31 pm

Here are some general things to keep in mind about using MEA:

  • If a dialog box is open, the buttons in it are "live", in the sense that they transmit to the guiding GVs.
  • After you use a dialog box, you may wish to dismiss it. The Esc key is the quickest, easiest way to do this.
  • If you don't dismiss dialogs, eventually you start to have a bunch of them hanging around, perhaps in the way.
  • The dialog boxes themselves do not transmit orders. They only set the GVs, which are read by the listener.
  • The listener will do extensive logging when you increase the DbgLevel (at the price of slowing things down).
  • Customers have the source code for the listener, and may examine it, alter it, extend it , etc.

Sam7768
Posts: 3
Joined: Mon Mar 24, 2008 7:59 pm
Contact:

Re: Questions and Discussion About Manual Entry Automation

Postby Sam7768 » Mon Mar 24, 2008 8:25 pm

This looks promising.

However, what I would like to know is...

1) Assume that I have placed a maual "buy"
2) I want the stop to become active automatically linked to an indicator (say ATR or SAR).
3) How do I make that happen?

Please advice. or even better, if you can put a small video on this.

Thanks

Sam7768
Posts: 3
Joined: Mon Mar 24, 2008 7:59 pm
Contact:

Re: Questions and Discussion About Manual Entry Automation

Postby Sam7768 » Mon Mar 24, 2008 10:39 pm

Also,

I was reading your other posts and have one doubt...

I use two min chart. suppose i place an order to buy, does the buy happens..

1) on the current bar or
2) At the bugining of next bar or
3) At the end of next bar?

Pl advice


Return to “Manual Entry Automation”

Who is online

Users browsing this forum: No registered users and 1 guest