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

Re:New indicator



PureBytes Links

Trading Reference Links

Jon,
See an AFL attempt in above #3773

--- In amibroker@xxxx, "jonf" <jonf_ca@xxxx> wrote:
> 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)