I am a new delphi programmer. I want to convert one aspect of a project I created in LabView to Delphi. The programmer that takes this SMALL project on must be a seasoned programmer that can provide code that is a good basis for me to follow in my future delphi programming projects. I have a good grasp of the basics but would like to see this app converted by another programmer to see where I may have taken another approach. The programmer must be open to newbie questions realated to this application.
Any controls used on the form mst be made during runtime and destroyed on exit to demonstrate the best possible memory management with no leak (using TRY blocks to force disposal of the controls once the procesure has ended).
The project is to perform simple calulations on stock market data. I need the programmer to be able to create FAST array calculations on large sets of data. An example could be a block of datat that ranges five years of daily data, each day comprsed of 78 records, each record holds open, high, low, close, and volume data
1. Setup a daily sub array of 5 minute data for example 9:35 to 10:30 ~10:35
-setup trade entry based on selected reference point, for exampl eif the open value is the ref and you enter an offset of -0.1, were you able to get into the trade if it was 0.1 less than th ereference value
2. Look at the sub data and compare it to an entry value to see if a trade could have been enetered
3. Look at the sub data and see if a trade could have been exited compared to a exit value or stop loss value
4. Track positive and negative gains
5. provide positive negative, forced exit positive, forced exit negative trade counts
6. Provide results in a table (approximately 15 pieces of data
7. Provide positive and negative trade results in a separate indicator
8. Save table data to csv
1. Splash screen -
2. Perform simple calcs on stock data file
(open, high, low, close)
Open a daily data file and calculate the following for a selected date range
- determine what the previous days movement was form the open to close, using the a selected data set data set
-determine what the opening move was from the previous days close to todays open
Create an array for each day the consist of the 5 minute data for each day
Set an ofset value or percenet in reference to a selected time bar (a selected previous day bar, todays opening value, or the first bar of a trade window selected for todays data (ie from 9:35 to 10:30, the offset would be from the 9:35 time bar selected data (open, high, low, close))
Review the selected data set in this case 9:35 to 10:30 minus the offset to determine if a stock trade could have been entered. For example: if the offset was -0.1 from the open bar of $3.00. That makes the target entry $2.90. Looking at teh window of 5 minute data from 9:35 to 10:30 was there a 5 minute span were the low was lower than $2.90 but the high was higher than $2.90. If so this becomes the entry bar.
set an exit target in value or percent and add it to the enetry value. For example the entry hewre was $2.90, so if an Exit target of 0.1 was set the exit target would be $3.00
now from the next bar after the entry bar say you got in at 9:45, that means the nest bat is 10:00. So from 10:00 to 10:30 was the a 5 minute time bar that had a low value lower than the EXIT target and a high bar higher than th eExit target (or eaqual) If so you go out of your trade HOWEVER - the same data needs to be reviewed to see if a stop loss was reached before an anexit target was reached. If a stop loss of 0.1 was set you have to review the 10:00 to 10:30 span to see if $2.90 - 0.1 = $2.80 was present before an exit target was reached. If so it would be astop loss exit with a negative gain of -0.1
If a Positive Exit or a Stop loss exit was not detected enforce a forced exit on the next time bar after the selected trade span window. In this case it is 9:35 to 10:30 so the enforced exit bar would be 10:35. Allow the user to select what to use for the enforced exit value from that time bar, LOW, HIGH, AVERAGE between the high and low. What ever this exit value works out to be it is to be used to calculate an exit gain.
Each days gain is to be tracked to provide a total gain / loss value for the selected period. If it is a stop loss or forced exit a SL or FE is to be added to teh end of the time bar for example 10:05-SL, represents a stop loss was triggered at 10:05