Note that there are some explanatory texts on larger screens.

plurals
  1. POFX Data - analyse intraday data
    primarykey
    data
    text
    <p>I've just found pandas and python recently. I've gone through Wes' book, plus I've repeatedly trawled through the pandas tagged questions here at SO to glean the answer to this question. So I have tried... My meagre programming intelligence is shining through unfortunately ;)</p> <p>Here is what I'm trying to do:</p> <p>I have Intraday FX data (hourly) which I am trying to do some pretty simple analysis on. I am looking to test how often the price tests the daily open level and either rejects it or passes through it. </p> <p>That seems simple to me.... I'm just lost in bringing all the components together to get to a final complete solution. </p> <p>In psuedocode here is what I am trying to achieve:</p> <ul> <li>read data in via read_csv</li> <li>calculate each daily open level (using at_time?)</li> <li>for all hourly candles <ul> <li>test if the candle low falls below the daily open level </li> <li>test if the close of the candle is above the daily open level</li> </ul></li> </ul> <p>If someone could please point me in the right direction I'd really appreciate it. I'm at the point where I'm going to give up on this. I feel the answer should be really simple, but I'm lost at the moment </p> <p>Here is the data I've been working with:</p> <pre><code>data = pd.read_csv('data/GBPUSD60.csv', names=['Date','Time','Open','High','Low','Close','Volume'], parse_dates={'Timestamp': ['Date', 'Time']}, index_col=['Timestamp']) # Get rid of the volume del data['Volume'] </code></pre> <p>resulting DF:</p> <pre><code> Open High Low Close Timestamp 2012-11-14 04:00:00 1.58766 1.58890 1.58749 1.58877 2012-11-14 05:00:00 1.58874 1.58887 1.58819 1.58849 2012-11-14 06:00:00 1.58849 1.58921 1.58831 1.58890 2012-11-14 07:00:00 1.58890 1.58895 1.58811 1.58876 2012-11-14 08:00:00 1.58874 1.58934 1.58841 1.58849 </code></pre> <p>I'm assuming I need to go about this one of two ways:</p> <ul> <li>either group the data by day and loop through the rows to test the intraday candles. </li> <li>Secondly, I could use the df.apply function and generate a function to test the candles</li> </ul> <p>The problem with either approach is that I get into all sorts of trouble trying to access the fields I need.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload