hgeorgako / rfortraders

Quantitative Trading with R
MIT License
189 stars 132 forks source link

inconsistancy in chapter 6 #13

Open 0x0Koda opened 8 years ago

0x0Koda commented 8 years ago

In the code errata on line 107 buy signals are created when the spread is below the threshold, Yet on line 255, buys are created when the spread is above the threshold, this doesn't make sense.

https://github.com/hgeorgako/rfortraders/blob/master/Chapter_06/code.R


buy_signals <- ifelse(spread <= level -
   lower_threshold, 1, 0)

buys <- ifelse(data_out$spread > threshold, 1, 0)
hgeorgako commented 8 years ago

Thanks Dane. Will investigate this and update the code.