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

RE System Coding Question



PureBytes Links

Trading Reference Links


The trouble with using marketposition is that if, say, marketposition = - 1 then you do not know if you are short from entry 1 or entry 2. You could try something like

buy("entry1") ........
buy ("entry2") -=------
exitlong from entry("entry1") ....
exitlong from entry("entry2"  ....

alternatively, depending on the type of system you are using, you could look at the bar before and see if you are long from entry 1 or entry 2. for example,

if marketposition = 0 then
buy("entry1") at high plus 5 points stop;
buy("entry2") at close 10 points stop;

if marketposition = 1 then
if close[1] + 10 points > high[1] + 5 points
then you are long from entry1 ( because market yesterday hit high[1] + 5 points before close[1]+10 points).

Of course if you are exiting on the same bar, things get a lot more complicated.

Tom.


--

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.