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

Re: Help with TS Programming



PureBytes Links

Trading Reference Links

At 10:20 AM +1000 8/15/99, Mel F wrote:

>I am just starting to program in TS4 (build 21) and have issues I
>can't work out.
>
>After zooming in on a chart I am sometimes unable to zoom out - I
>have to reformat the bar number spacing to get it zoom out.
>
>Also I have come up with some conflicts with some simple systems I am
>working on.
>
>In some cases I am having a trade exit and enter on the same bar and
>at the same point on the bar. How can I program this out in EL.

A common cause of this problem is that your entry condition is still 
valid when your system exits, either from an exit statement of from a 
stop. In this case, the system will immediately reenter. You can 
sometimes use BarsSinceExit function in your entries to prevent this. 
You can also use the MarketPosition function to cancel the entry 
conditions. The exact usage would depend upon what you are trying to 
do but an example is shown below:

    if <some_condition> then BuyOK = TRUE;
    if BuyOK and BarsSinceExit > 5 then Buy on close
    if MarketPosition <> 0 then BuyOK = FALSE;

>
>In writing systems is it possible to reference existing indicators
>rather than rewriting them Eg: the Price Oscillator is not available
>in the Function part of the Power editor (or at least I can not find
>it).

The is not possible but you can usually copy and paste the code from 
the indicator into the system and make a few modifications.

>In testing a simple system with (buy only for xxxx number of shares,
>single entry only determined by oversold condition and a trend
>following indicator) and only one exit (a moving average crossover)
>with money management and percentage risk trailing stop. If I have
>"Apply on Position Basis" checked in the Stops dialogue box I get
>different results to when I check the "Per Contract Basis". In the
>"Apply on Position Basis" the trades are short (avg bars wins=3 and
>losses 14, number of trades=30 ) with all but one trade being exited
>by a stop ( the exit for the MA crossover is an "exitlong "
>condition. The "Per Contract Basis" scenario the (avg bars wins=32
>and losses= 83, number of trades=10 ) there are no money management
>stops as exits in the report - they are all exited by the MA crosover.

On a "Per Contract Basis" many of the numbers get multiplied by xxxx 
if you re buying xxxx shares. See the documentation for how these 
stops work.

Bob Fulks