Go Back   DailyFX Forex Forum | FX Forum > FXCM Products and Services > FXProgrammers > Discussion / Support Forum > General Discussion

Reply
 
Thread Tools Rate Thread
  #1 (permalink)  
Old 07-01-2006, 08:10 PM
Member
 
Join Date: May 2006
Posts: 9
FX42n is on a distinguished road
Solution For Automatically Updating High/Low Values

' Happy Day! After several weeks of conducting research and testing, I finally discovered comprehendable instructions for building a macro somewhat related to my needs.

Since I have not seen a working solution here, I thought to provide this solution for the benefit of others who may need to build a similar rule. My workbook was constructed starting with Column A, and set in the order listed below. It also includes a header row in Row 1, with the current period located in Row 2, and the data table is sorted by time, descending. The snippit was written to manipulate the fields "C2" (current high) and "D2" (current low) with the current Bid Price found in "G2."

___DATE/TIME____|OPEN___|HIGH___|LOW_____|CLOSE__|_______N OW________|BID______|ASK
6/30/2006 16:00__|114.43__|114.43__|114.42__|114.43__|30/06/2006 16:00:01__|114.43__|114.47


Snippit is as follows:
--------------------------------------------

Private Sub worksheet_change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False

If Range("G2").Value > Range("C2").Value Then
Range("G2").Select
Selection.Copy
Range("C2").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
End If

If Range("G2").Value < Range("C2").Value Then
Range("G2").Select
Selection.Copy
Range("D2").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
End If

ws_exit:
Application.EnableEvents = True
End Sub

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

Because the FXCMRTD DDE is inactive today, being Saturday, I don't know if this actually works. I would have included the .xls file as a zip attachment for others to test, but this solution does not address a secondary problem: updating the data table with new periods when the current period expires. I will begin to address this issue shortly, if this snippit proves to be accurate and effective.

Best wishes in your trading....
Reply With Quote
  #2 (permalink)  
Old 09-18-2006, 03:28 PM
Member
 
Join Date: Sep 2006
Posts: 10
aap21 is on a distinguished road
Were you able to find a solution on how to update after the period ends?

Thanks
Alex
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




Disclaimer: Trading foreign exchange on margin carries a high level of risk, and may not be suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to trade foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with foreign exchange trading, and seek advice from an independent financial advisor if you have any doubts. Any opinions, news, research, analyses, prices, or other information contained on this website is provided as general market commentary and does not constitute investment advice. Forex Capital Markets LLC. will not accept liability for any loss or damage, including without limitation to, any loss of profit, which may arise directly or indirectly from use of or reliance on such information.

All times are GMT -5. The time now is 08:17 PM.
Copyright ©2009 Daily FX. All Rights Reserved.