PureBytes Links
Trading Reference Links
|
Dimitris,
My objective is just to test the validity of an single indicator or an entry
strategy (without looking into confirmation rule, exit strategy or portfolio
management, this is done in another step). One test (but not the only one)
that can be done is to know what is the % of trades that go into the right
direction after N days. If this % is less than say 55%, I will completely
ignore this entry strategy and look for other.
In fact now I realize that all trade must be taken. #1: buy1-sell1, #2:
buy2-sell2, #3: buy3-sell3. Even if they crossed between each other.
Now to answer your question, I will give more detail in the different
buy/sell signal examples.
Let's assume that 3 buy signal are generate by an indicator at 3 specific
day.
day1 : buy1
day3 : buy2
day7 : buy3
Let's assume that sell signal is generate 5 days after the buy:
day6: sell1
day8: sell2
day12: sell3
Now let's put this in order of time:
[day1:buy1, day3:buy2, day6:sell1, day7:buy3, day8:sell2, day12:sell3]
1st solution
sell = ref(buy, -5), inside the back test generate 2 trades: [buy1-sell1]
and [buy3-sell2]
2nd solution
sell = barssince(buy) == 5, generate one trade: [buy1-sell3]
3rd solution
script provides by tomasz generate what I was asking. [buy1-sell1] and
[buy3-sell3].
Jon (alias Dali)
----- Original Message -----
From: "DIMITRIS TSOKAKIS" <TSOKAKIS@xxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Friday, August 10, 2001 9:18 AM
Subject: [amibroker] Re:New indicator
> --- In amibroker@xxxx, "Dali" <dali_11@xxxx> wrote:
>
> For example given the signal in order of time: [buy1,
> > buy2, sell1, buy3, sell2, sell3], it will generate 2 trades [buy1-
> sell1] and
> > [buy3-sell2]. But what I want is [buy1-sell1] and [buy3-sell3] to be
> > generate.
> > Jon
>
> Hi Jon,
> I try to understand what you ask here:
> As you describe, you want
> buy 1=BUY #1
> buy 2
> sell 1=SELL #1
> buy 3=BUY #2
> sell 2
> sell 3=SELL #2
>
> A. It seems that you prefer the first "buy" and ignore the rest. O. K.
> B. My question is about "sell". What do you want ?
> The first pair #1, you sell with the first "sell" signal.
> The second pair #2 you want something different, you
> ignore the first "sell" and prefer the second "sell", or the
> last "sell"
> How do you know that a second "sell" will exist ?
> When you are at day "sell 2", the rest is in the future.
> I do not know how will you ignore the first "sell" you find.
> If possible, please explain.
>
> Thank you in advance.
> Dimitris Tsokakis
>
>
>
>
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
|