[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Writing a system in Easy Language



PureBytes Links

Trading Reference Links

Jerry,

>After spending years writing indicators. I am finally getting
>around to attempting to use TS to implement a system. Over the many
>years of subscribing to this list I have glossed over many of the
>posts regarding entries and exits in easylang. I have the sense
>that attempting to enter and exit on the same bar ( next bar ) is
>problematic. Can someone confirm this ? I searched traders2traders
>and tssupport. Does there exsist anywhere a discussion of these
>issues.

It's been discussed here from time to time.  The issues boil down
basically to one thing:  Strategies are always calculated at the end
of each bar, not updated on every tick like indicators.

There are some ways around this limitation:

1.  Design your system to make heavy use of limit orders and stops
for execution on the next bar.  You CAN have multiple entries and
exits on the same bar, provided the orders were placed on the
previous bar.  For example, I can set a buy stop, buy limit, sell
stop, and sell limit on the same bar.  If I assiged name tags to the
orders to distinguish them, I can set multiple buy stops, multiple
buy limits, multiple sell stops, and multiple sell limits, all to
execute on the next bar.

2.  Doing #1 above will take care of a lot of problems, but you
still have the problem of conditional orders that you may want
to place within a bar.  Like for example, if an entry order was
filled and it moves X ticks in your favor, you might want to move
a stoploss order to breakeven, before the bar has completed.  One
way to do this: Say your strategy runs on 10-minute bars, so have
your strategy running on very short (1 minute bars) but keep track
internally of 10 minute bars for the internal calculations.  Another
way is to use PushPop to pass values between a strategy and an
indicator running on different time frames.

My recent experience with PushPop makes me not want to trust it.  I
tested a strategy that took values through PushPop from an indicator
plotted on the same time frame on the same chart.  The strategy also
calculated the same indicator internally.  You would think that the
two results (the strategy's calculation of the indicator and the
value of the same indicator passed from PushPop) would be the same,
but they weren't.  And the differences can't be explained.  Like
I'm passing -1 and +1 to indicate slope, and the indicator shows a
string of positive slopes, but PushPop somehow gets -1 values from
the indicator during that string of positive slopes.  The strategy
works BETTER with the erroneous values, but until I understand
what's going on, I don't want to trust it.

-- 
  ,|___    Alex Matulich -- alex@xxxxxxxxxxxxxx
 // +__>   Director of Research and Development
 //  \ 
 // __)    Unicorn Research Corporation -- http://unicorn.us.com