| 77 | |
| 78 | |
| 79 | def make_record(data, i): |
| 80 | s = data.ix[i,:] |
| 81 | entry_nbar = s['entry_0':'entry_N'].tolist() |
| 82 | exit_nbar = s['exit_1':'exit_N'].tolist() |
| 83 | entry_nbar.pop() |
| 84 | exit_nbar.pop() |
| 85 | rec = Record() |
| 86 | rec.entry_datetime = data.index[i] |
| 87 | rec.entry_bar= s['entry_bar'] |
| 88 | rec.exit_bar = s['entry_bar']+s['period']-1 |
| 89 | rec.entry_price = s['entry_price'] |
| 90 | rec.exit_profit = s['exit_profit'] |
| 91 | rec.period = s['period'] |
| 92 | rec.low_profit = s['low_profit'] |
| 93 | rec.high_profit = s['high_profit'] |
| 94 | rec.entry_nbar = entry_nbar |
| 95 | rec.exit_nbar = exit_nbar |
| 96 | return rec |
| 97 | |
| 98 | |
| 99 | def frame2records(data): |