PDA

View Full Version : Novice At 4X, VBA, and wish assistance


FX42n
05-04-2006, 01:22 PM
Greetings. I am wondering if there is a resouce here that will teach me how to build my own chartring macros and stand alone apps that won't require Excel. I just got connected with DDE, and am happy with it but know I am under-utilizing the tool. Having used Trade Station II, I realize there is much more I can be doing with the data in Excel.

I own a copy of Visual Studio 2003, and have had limited success programming on it. I possess three books on Excel VBA, 1) Excel 2003 Bible, 2) MOS Study Guide, and the one I found most useful, 3)Using Excel Visual Basic fo Applications, however none of these resources have shown me how to create things like an ROC study or and EMA.

Any feedback would be appreciated. Thanks.

caprica
05-04-2006, 10:36 PM
It sounds like you have got quite a journey ahead of you ...

At this stage is you are probably not ready to dip your toes into the waters of fx programming until you have learned more about the market structure of the foreign exchange market, technical/fundamental analysis, risk management and general programming. A good place to start would be to learn discretionary trading using the chart and news plugin for the FXCM trading station (or one of the many other good charting packages out there), and in the background read widely, participate in lots of forex forums and teach yourself to program.

Once you have gotten youself a good foundation, you should have a shot a fxprogramming.

p.s. no matter how deperate you get - NEVER under any circumstances give anyone any money for an expensive (i.e. more than a few hundred dollars) product, training course, or mentoring package - no matter how good it sounds or what "special" deals they are offering. There are way too many sharks out there willing to take you for a ride. You CAN learn this stuff for yourself - it just takes patience and dedication.

FX42n
05-09-2006, 12:51 PM
To say that I am not ready to begin programming in FX is accurate, even though I have developed an elementary awareness of Forex fundamentals because of DailyFX and ActionForex, two sites which offer RSS Fundamental news subscriptions.

I have found that FXCM's FX Trade Station II is very convenient for recreating studies and backtesting experiments because it allows for users to export data to Excel. Because I am able to manipulate this information in Excel, I am able to recreate other people's work and see if I get the same results. I have received more benefit in understanding of how the Forex market acts and reacts from these two approaches, than by using a demo that offers signals.

However, because the exported data is never current, it makes this information less useful than it can be. Thus, when I discovered FXCM's DDE, I was very excited because now I have access to current data on which I can observe how my experiments react in live conditions. Now, I am stumped on how to perform some Excel VBA functions. I am able to build my own workbooks for each Currency Pair, and able to link worksheets, but


:eek:) I am unsure how to stop the data from updating in a linked cell :eek:
:eek:) How to close periods and begin new ones :eek:


Thus I have come here to FXProgrammers to see if someone can share a snippet, or better yet, teach me how to build the function.

Charts, Userforms, and macros are areas I am competent enough to stumble through. For things I can't work out by myself, I reference my books. If I can't find a solution there, I search EXCEL VBA sites, like J-Walk and ExcelTip.

However, this is my first experience working with a dynamic data exchange, and thought this forum might be the best place to get tips on how to work with DDE. I noticed there is no Application Building Forum, where persons can go to share knowledge and request information, so I concluded the General Forum may be the best place to ask for help.

Thanks for your replies.

chrisi
06-23-2006, 11:38 AM
I think I have the same issues with you. I know excel very well and i developed most of the indicators in excel. I have a separate data excel file, in which I update my currency data through FXCM (export function) and my indicators excel file, in which I calulate the values of my indicators. To avoid having large sizes of excel file, I copy/paste value at the end of each period. My Formulas are only in one row.
Currently I have been exposed to DDE and I realised that I have to rearrange my excel files so the most current price/data to be at first rows.
So what I really need is to develop a file that arrange the streaming data in certain periods and then link this data file with my indicators file so all indicators to be calculated live.
I am currently, trying to learn how to do this and I will appreciate if you can share info with me.

FX42n
06-24-2006, 12:24 PM
To arrange your data tables so that the current period is at the top of the spreadsheet, instead of using the export function

1. Use the Right Click Copy function on the data table and
2. Paste to Excel.

You will find that the data is copied exactly the way the data table appears in the platform. However, if you prefer to use the export function of the charting plug-in, after you export the data table to Excel,

1. Select the entire data table.
2. Go to "Data" in the Menu Bar and select "Sort."
3. If your list has Date/Time, Open, High, Low, Close, it has Header Rows. Make sure the Radio Button is properly selected.
4. Select Column A ("Date/Time") and "Descending."

This action will sort the data table by date and time in a descending order.

-----------------------------------------------------------------------

As for linking worksheets, that is not a problem either. In you indicator file, Add the following in Column A, Row 1:
='[workbook.xls]sheet1'!$A$1

Replace [workbook.xls] with the name of your data workbook. [EURUSD.xls] for example)
Replace sheet1 with the name of your data table worksheet.
Of course, $A$1 refers to the cell in the worksheet in your databook you are linking to your indicator file.
In case you don't know, $ locks the the column/row so the formula won't change when you copy and paste it somewhere else. It is not necessary to include in this formula.

----------------------------------------------------------------------

To make your indicators show the current rates, in the Close cell of the current period, add the following
=FXPS|BID!'EUR/USD'

Change EUR/USD for whichever currency pair you are studying.

I find it is easier to add the dde link in a separate cell, such as F1, and incorporate F1 into my formula, instead of E2 (where my close value is for the present period, because I use E1 is a header cell).

--------------------------------------------------------------------

As for building new periods, I haven't found a way to write macros into my formulas yet. From what I understand, macros in formulas can only perform functions formulas allow. However, I have not been successful in adding a any kind of macro to a formula yet.

Thank you for the opportunity to be of assistance. I hope my suggestions have provided workable solutions for you, and added useful insights to your dilemma.


Side note:
I have tried using the following function:
=IF(PRICE>HIGH,PRICE,HIGH).
=IF(F1 >C2 ,F1 ,C2)

However, once Price falls below the original HIGH value, any record of a new high value is lost. Thus, this rule requires the overwriting of the original High values.

I have used the PasteSpecial Paste:=xlValues Excel function in a macro, so that the new PRICE value overwrites the old HIGH value, but don't know how to incorporate this function into a formula, or how to automate the macro to trigger when Price exceeds High. My current solution is to recopy the TS2 data table to my charting workbook once new highs and lows have been reached.

Once I learn how to overwrite values automatically, then it is possible to keep accurate records of highs and lows for the current period. Not only that, but I can then copy PRICE values to a new row and start a new period. Of course, this means I have to find a way to trigger a rule for when =FXPS|TIME!'EUR/USD' reaches whatever :mm:ss timeframe I decide to record in.

Thus, I am still seeking to find two rules:

1. Automated Overwriting of values.
2. Automated establishment of additional rows determined by periods of time.

I hope this has been helpful and useful. Please feel free to ask me more questions, but I'm afraid this is probably the limit of my usefulness. Best of luck with your trading.