title: Pandas trade signal columns
body: <p>I am trying to add columns showing a value of 1 where a trade signal is seen.  I have put together the following test data to show what I am trying to do.</p>
  
  <p>Create test dataframe:</p>
  
  <pre><code>import pandas as pd
  import datetime
  index = pd.date_range('2013-1-1',periods=100,freq='30Min')
  data = pd.DataFrame(data=list(range(100)), columns=['value'], index=index)
  </code></pre>
  
  <p>On 2013-01-01 we can see that between the times 09:30 - 10:30 the max value is 20 and the low is 19.</p>
  
  <pre><code>data.ix['2013-01-01 09:30:00':'2013-01-01 10:30:00']
  
  
  value
  2013-01-01 09:30:00 19
  2013-01-01 10:00:00 20
  2013-01-01 10:30:00 21
  </code></pre>
  
  <p>I want to create new columns called "enter_long" and "enter_short" that on each day will add a 1 the first time the max or min of <code>hour_1_session</code> (see below) is passed.  Only once per day so it can't have a 1 in enter_long and a 1 in enter_short on the same day.</p>
  
  <p>This is the desired output and on this day it shows at 10:30 the value column was > the max of <code>hour_1_session</code> (max between the times 09:30 - 10:30).  In order to populate the enter_short column 'value' would have needed to be &lt; 19.  </p>
  
  <pre><code>                  value enter_long enter_short
  2013-01-01 09:30:00 19    0          0
  2013-01-01 10:00:00 20    0          0
  2013-01-01 10:30:00 21    1          0
  2013-01-01 11:00:00 22    0          0
  2013-01-01 11:30:00 23    0          0
  </code></pre>
  
  <p>I can use the following to get this data but I don't know how to add new dataframe columns as per my question above:</p>
  
  <pre><code>daystart = '9:30'
  hour_1_end = '10:29:59'
  dayend = '16:14:59'
  
  hour_1_session = data.between_time(daystart,hour_1_end, include_start=True, include_end=True)
  day_session = data.between_time(daystart,dayend, include_start=True, include_end=True)
  
  hour_1_high = hour_1_session['value'].rolling(window=1,freq='D').max()
  hour_1_low = hour_1_session['value'].rolling(window=1,freq='D').min()
  
  hour_1_high
  
  2013-01-01    20.0
  2013-01-02    68.0
  Freq: D, Name: value, dtype: float64
  </code></pre>