Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

New SharedHash object Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
Kuf
Posted : Friday, January 29, 2010 9:35:15 AM


Administration

Joined: 9/18/2004
Posts: 3,522
As of build 173 there is a way to share memory between indicators and conditions on a chart. 

Accessing this memory may slow down your calculations as it needs to synchronized the memory space so multiple calculations aren't reading/writting from the same memory.

Below are two RealCode Indicators. The first one calculates and creates the data to be shared, the second one waits for the first one to finish and then reads the shared data.

'|******************************************************************
'|*** StockFinder RealCode Indicator - Version 4.9 www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Indicator:Shared Data Creator
'|******************************************************************
If isFirstBar Then
    lock("MyData")
End If

plot = price.close

If isLastBar Then
    Me.setSharedHashValue("MyData", price.close)
    unlock("MyData")
End If






'|******************************************************************
'|*** StockFinder RealCode Indicator - Version 4.9 www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Indicator:Shared Data Reader
'|******************************************************************
Static plotVal As Single
If isFirstBar Then
    plotVal = Single.nan
    If WaitForUnlock("MyData", 5000) Then
        plotVal = Me.getSharedHashValue("MyData")
    End If   
End If
plot = plotval




Ken Gilb (Kuf)
Chief Software Engineer - Worden Brothers Inc.
Try/Catch - My RealCode Blog
Kuf
Posted : Friday, January 29, 2010 9:39:27 AM


Administration

Joined: 9/18/2004
Posts: 3,522
The key methods are below:

lock(key) -  Locks a key value so calculations that need to access the shared data will wait until the value is set and unlocked.  Key should be a unique string that no other indicator will be using.

setSharedHashValue(key,object)  -  Sets a value to the shared memory space. The key is a unique string for the object being set. 

unlock(key) - Unlocks the key so that other calculations that are waiting for the shared data are notified that it has been updated and it is safe to read.   Use the same key as lock and setSharedHashValue

WaitForUnlock(key,TimeoutMilliseconds) - Calling this blocks your code from running until unlock is called on the key parameter or the Timeout in Milliseconds is reached.  If it returns true, the key was unlocked succesfully. If it returns false, the timeout was reached before unlocked was called.

getSharedHashValue(key) - returns the object from setSharedHashValue(key,object).

Ken Gilb (Kuf)
Chief Software Engineer - Worden Brothers Inc.
Try/Catch - My RealCode Blog
Flash99
Posted : Friday, January 29, 2010 2:16:36 PM
Platinum Customer Platinum Customer

Joined: 7/16/2009
Posts: 411
Kuf, there is something strange when shared object is used in a filter/scan
I save the following realcode condition:
' Set SHARED KEY

If isLastBar Then

    lock(Me.CurrentSymbol)
    Me.setSharedHashValue(Me.CurrentSymbol, "my key value " & Me.CurrentSymbol)
    unlock(Me.CurrentSymbol)
   
    If WaitForUnlock(Me.CurrentSymbol, 5000) Then
        log.info("--- Test my set for " & Me.CurrentSymbol & " value = " & Me.getSharedHashValue(Me.CurrentSymbol))
    Else
        log.info("--- WaitForUnlock FAILED for " & Me.CurrentSymbol)
    End If       
End If


The code works just fine in a  chart for the current symbol.
If I run a filter/scan, in a personal watchlist with 20 stocks, based on the condition above, WaitForLock fails for each stock.

Thanks
Kuf
Posted : Friday, January 29, 2010 4:20:09 PM


Administration

Joined: 9/18/2004
Posts: 3,522
The code will only work on a chart. I didn't qualify this but the shared object is shared with the chart. If you want to run your calculation on a list of symbols, run it as a market indicator.

Ken Gilb (Kuf)
Chief Software Engineer - Worden Brothers Inc.
Try/Catch - My RealCode Blog
Flash99
Posted : Friday, January 29, 2010 7:04:16 PM
Platinum Customer Platinum Customer

Joined: 7/16/2009
Posts: 411
Thank you but this means that this is not a shared space at the application level. Maybe I am confused but don't see how a market indicator could help me.
All I wanted was a Microsoft.VisualBasic.Collection that I could access from any chart any timeframe..., without any restrictions.
Kuf
Posted : Sunday, January 31, 2010 2:30:48 PM


Administration

Joined: 9/18/2004
Posts: 3,522
The shared space is chart specific, it has to be for there to be any consistance and concurrency in the locking/unlocking of shared variables. You can put any collection you want in the key/value pairs.  A market indicator will help you if you're trying to do a list based computation. 

Perhaps if you share what you're tyring to implement I can help you come up with a solution.

Ken Gilb (Kuf)
Chief Software Engineer - Worden Brothers Inc.
Try/Catch - My RealCode Blog
jas0501
Posted : Sunday, January 31, 2010 5:46:33 PM
Registered User
Joined: 12/31/2005
Posts: 2,499
This is a nice new feature. 

It does intersect the "I wish I could" area. It also touches on the "IsListCalc" added feature and would be even more powerful if it could be used in domains other than chart. So i will renew by request for changing isListCalc to an enum. See Suggestion: before there is a significant code base replace isListCalc with...  

In the abover post was

The simple goal is to be able to loop over a watchlist multiple times and output the plot on the last pass.

The implication is the data be accessible accross symbols. This wouldpermit rankning, stanndard deviation, correlation, parameter tuning, and whatever else the coder could imagine.

If one could do it in the Export domain then the results could be exported. If restricted to Market Indicator domain there is now way to output the values.


Not trying to hijack the thread but as an implementation example how about:

Plot the 2 week performance rank, where the rank is computed on the last day of the week and used for the next week. This would permit backtesting rotation of stocks based on rank:
  o Exit if not in the top ten
  o Enter if in the top ten.

This demonstrate the need for multi-pass list process as the rank can't be assigned with only one pass as werll as shared memory access accross symbols. Adding a loop count or and exit condition on the Market Indicator pass and/or Export pass would address this.

Granted this could be very cpu intensive but starting it and 10:00PM and checking the results the next day at 7:00PM would permit 21 hours of cpu processing.



Future standard IO will provide more flexibility. The results of a long test may be best saved and the loaded rather than recomputed. Then for example one could compose a 2 week performance rank indicator and just load the values from a file. Weekly the process could run to compute the lastest ranks and update the files.

The user defined 2 Week Performance Rank would just read the file and be plotted lake any other indicator.


Flash99
Posted : Sunday, January 31, 2010 11:36:51 PM
Platinum Customer Platinum Customer

Joined: 7/16/2009
Posts: 411
QUOTE (Kuf)

Perhaps if you share what you're tyring to implement I can help you come up with a solution.

Sure, I have a filter with realcode condition in a 5 minutes timeframe running every 5 mins.
The values I am interested to get from this 5 mins timeframe are mainly prices (low,high,...). I want to be able, while in the 5 minutes timeframe, to access information from a higher timeframe (15 mins, 60mins, daily, for example). The values I want to read from higher timeframes are in general indicators stochastics, MAs, and others.
Things I want to do: (in fact this is what I am doing, but using registries...)
1. I am in the 5 minutes timeframe and I can read the high and low prices, it's easy to determine the price is moving down. If I can get the MA20 value from a daily timeframe, then I can implement the following rule:
- if the price crosses down the daily MA20, don't do anything (let's say I am not interested in a breakdown), but if it crosses up (after 1,2, 10mins), then alert me, because there is a good chance this is bounce back from daily MA20.
2. Catch discrepancies between trends in different time frames and convergence of indicator values from different time frames.
3. Calculate upside/downside potential. You know the way the market turns, usually a whole sector goes down, then it  turns. When the reversal occurs, SF5 calculates the potential  for gain for each stock, based on distance from local position to major resistance support levels (from higher time frames) and gives  me the possiblity to choose the one with maximum potential. If a stock has 3% upside from current position to MA20 daily, compared to another one from the same group with a 5%, it's easy for me to make a choice.
And I can keep going till tomorrow...

What I want to have is access to data (indicator values) from any timeframe. Most of this can be done now with the filters & sort columns but cannot implement the kind of logic and fine tunning I want. My mehod is also optimized, do not have to run a filter every 5 mins to get data from a 60 mins timeframe.

This is what I am doing now:
1. I execute one time only (in the morning) a realcode condition in a filter with daily timeframe for my watchlist.
This condition reads indicator values from the daily time frame for each symbol and writes the information in the registries (I have a tree structure).
This means that I have now in registries the daily indicator values for each symbol.
2. I execute another realcode condition in a filter with a 60mins time frame for my watchlist (runs every 60mins).
This condition reads indicator values from the 60mins time frame for each symbol and writes the information in the registries. The information is updated every 60 mins.
This means that I have now in registries another set of values for each symbol from a 60 mins timeframe
3. I execute another realcode condition in a filter with a 5 mins time frame for my watchlist (runs every 5 mins).
This condition reads the information stored in the registries by the first 2 conditions. The whole logic is in this condition, and makes use of data read from registries (in fact from different time frames). This gives me a high control over what & when I want to trigger. I use debug log as output, because I can centralize everything in one place and it's easy to compare/decide which stock I should go with.

Thank you
Flash99
Posted : Sunday, January 31, 2010 11:51:08 PM
Platinum Customer Platinum Customer

Joined: 7/16/2009
Posts: 411
jas0501, I read your post, and I think we are going different ways with this. I think I should specify that I am a day trader and my expectations from this shared space might be a little bit different than the expectations/requirements of a longer term investor. Hope Kuf will find a way to merge both worlds.
jas0501
Posted : Monday, February 1, 2010 12:14:19 AM
Registered User
Joined: 12/31/2005
Posts: 2,499
QUOTE (Flash99)
QUOTE (Kuf)

Perhaps if you share what you're tyring to implement I can help you come up with a solution.

Sure, I have a filter with realcode condition in a 5 minutes timeframe running every 5 mins.
The values I am interested to get from this 5 mins timeframe are mainly prices (low,high,...). I want to be able, while in the 5 minutes timeframe, to access information from a higher timeframe (15 mins, 60mins, daily, for example). The values I want to read from higher timeframes are in general indicators stochastics, MAs, and others.
Things I want to do: (in fact this is what I am doing, but using registries...)
1. I am in the 5 minutes timeframe and I can read the high and low prices, it's easy to determine the price is moving down. If I can get the MA20 value from a daily timeframe, then I can implement the following rule:
- if the price crosses down the daily MA20, don't do anything (let's say I am not interested in a breakdown), but if it crosses up (after 1,2, 10mins), then alert me, because there is a good chance this is bounce back from daily MA20.
2. Catch discrepancies between trends in different time frames and convergence of indicator values from different time frames.
3. Calculate upside/downside potential. You know the way the market turns, usually a whole sector goes down, then it  turns. When the reversal occurs, SF5 calculates the potential  for gain for each stock, based on distance from local position to major resistance support levels (from higher time frames) and gives  me the possiblity to choose the one with maximum potential. If a stock has 3% upside from current position to MA20 daily, compared to another one from the same group with a 5%, it's easy for me to make a choice.
And I can keep going till tomorrow...

What I want to have is access to data (indicator values) from any timeframe. Most of this can be done now with the filters & sort columns but cannot implement the kind of logic and fine tunning I want. My mehod is also optimized, do not have to run a filter every 5 mins to get data from a 60 mins timeframe.

This is what I am doing now:
1. I execute one time only (in the morning) a realcode condition in a filter with daily timeframe for my watchlist.
This condition reads indicator values from the daily time frame for each symbol and writes the information in the registries (I have a tree structure).
This means that I have now in registries the daily indicator values for each symbol.
2. I execute another realcode condition in a filter with a 60mins time frame for my watchlist (runs every 60mins).
This condition reads indicator values from the 60mins time frame for each symbol and writes the information in the registries. The information is updated every 60 mins.
This means that I have now in registries another set of values for each symbol from a 60 mins timeframe
3. I execute another realcode condition in a filter with a 5 mins time frame for my watchlist (runs every 5 mins).
This condition reads the information stored in the registries by the first 2 conditions. The whole logic is in this condition, and makes use of data read from registries (in fact from different time frames). This gives me a high control over what & when I want to trigger. I use debug log as output, because I can centralize everything in one place and it's easy to compare/decide which stock I should go with.

Thank you

Interesting solution. 

Your goal is more of a global memory share accross charts or between charts and watchlist columns. It appears the current feature can't accomplish this.


As an aside and not advancing Stockfinder's capabilities, it occurs to me you could load your 5 minute data into the registers as well and have a seperate application manage the alert announcements. This would permit a more dynamic announcement than the debug.log.


 
progster
Posted : Monday, February 1, 2010 7:49:11 AM
Registered User
Joined: 6/14/2005
Posts: 628
Two capabilities that are very useful to have:

1.  Application-level global variables - Anyone can read 'em, anyone can write 'em.  Locking not required.  Each variable has a realtime value that persists until it is changed, or the application exits, period.

2.  Globally accessible series values (in effect, synthetic tickers).  Once created, these are available in memory, and/or writable to database on disk for future reference without need to recalculate.

These can be implemented via external DLLs (if the platform allows such), or could be built-in to the platform itself.

For users and programmers, the utility and practicality of such implementations has been definitively established on platforms other than SF. 

If there is something about the architecture of SF that makes such things particularly difficult to implement in SF, then that's another issue, a technical internal issue (not to trivialize it, if it's real (?)).  However, internal level-of-difficulty is a separate question from all of:  "can it be done", "would it be useful", "would the product be more powerful, flexible, sellable if it was available", etc.

I would see these capabilities as something desirable to add some time after the 5.0 release.

Getting the chart-level Hash as described above into 5.0 is certainly a nice incremental advance, and I applaud it.
Flash99
Posted : Monday, February 1, 2010 8:30:10 AM
Platinum Customer Platinum Customer

Joined: 7/16/2009
Posts: 411
QUOTE (jas0501)

Your goal is more of a global memory share accross charts or between charts and watchlist columns.


Cannot say it better myself.

QUOTE (jas0501)

As an aside and not advancing Stockfinder's capabilities, it occurs to me you could load your 5 minute data into the registers as well and have a seperate application manage the alert announcements. This would permit a more dynamic announcement than the debug.log.

I don't understand what you mean by a "separate application"; an application outside SF5 ?
Thank you
Flash99
Posted : Monday, February 1, 2010 9:56:58 AM
Platinum Customer Platinum Customer

Joined: 7/16/2009
Posts: 411
QUOTE (jas0501)

As an aside and not advancing Stockfinder's capabilities, it occurs to me you could load your 5 minute data into the registers as well
 

Not quite, for what I am doing. I need the price action from a short time frame (5mins) to look for price patterns such as hammer, bullish/bearish engulfing, shooting star, and some of them involve more than one bar. Once a pattern is identified, then I look for validation from higher time frames, and calculate potential movement.
Kuf
Posted : Monday, February 1, 2010 9:58:12 AM


Administration

Joined: 9/18/2004
Posts: 3,522
Flash 99. Would an easier solution be the ability to access any symbol/timeframe from RealCode?


Ken Gilb (Kuf)
Chief Software Engineer - Worden Brothers Inc.
Try/Catch - My RealCode Blog
Kuf
Posted : Monday, February 1, 2010 10:09:30 AM


Administration

Joined: 9/18/2004
Posts: 3,522
QUOTE (progster)


1.  Locking not required.  Each variable has a realtime value that persists until it is changed, or the application exits, period.



Locking is only required if you want the "reader" to wait for the "writer" to finish.

Ken Gilb (Kuf)
Chief Software Engineer - Worden Brothers Inc.
Try/Catch - My RealCode Blog
Flash99
Posted : Monday, February 1, 2010 10:15:35 AM
Platinum Customer Platinum Customer

Joined: 7/16/2009
Posts: 411
QUOTE (Kuf)
Flash 99. Would an easier solution be the ability to access any symbol/timeframe from RealCode?

Easy yes, but I think it would be less efficient/flexible.
Let's say I am in a realcode time frame 5 mins and filter is executed every 5 minutes,  and I need data from a daily or 60mins timeframe, I don't want to read the information every 5 minutes.
Kuf, access to a global Microsoft.VisualBasic.Collection without any restrictions (locking, ...) would be the most flexible, efficient, ... solution. This should be a user's space, to do whatever he wants with it, without you guys being concerned about threading, or other issues.
Kuf
Posted : Monday, February 1, 2010 10:51:01 AM


Administration

Joined: 9/18/2004
Posts: 3,522
You just don't understand Flash99. If we are not concerned about threading and locking issues, then you will get bad data in your global memory and ask us why it's wrong. 

I do understand what you are asking for. I was suggestion another implementaion that would skip all the global variable mess and still be just as fast.

Ken Gilb (Kuf)
Chief Software Engineer - Worden Brothers Inc.
Try/Catch - My RealCode Blog
Flash99
Posted : Monday, February 1, 2010 11:34:51 AM
Platinum Customer Platinum Customer

Joined: 7/16/2009
Posts: 411
QUOTE (Kuf)
You just don't understand Flash99. If we are not concerned about threading and locking issues, then you will get bad data in your global memory and ask us why it's wrong. 

Kuf, please believe me it's not because I do not understand. I do understand, but whatever solution you implement, other than a global collection, it will not be flexible/useful enough.
This is because when a team develops/implements a solution, this is in reply to a specific task/problem the solution is supposed to solve. In this case, the task would be to get data from different time frames, but it's not only that. It's much more than that. This was just an example of why I needed the object.

A global collection could be a meeting point where different realcode modules may share information, and do lots and lots of other things.
And do not be concerned about threading and locking (think I said this 10 times). If I get bad data, so be it, it's a price I am more than willing to pay. But I can make sure this will not happen. I promise I will not ask you why it's wrong. If it happens, I will know why is wrong.
You may specify in the documentation that it's not thread safe, it's risky, and the user must deal with threading issues, and it poses the risk of providing bad data, and no support is provided for this object...
Flash99
Posted : Monday, February 1, 2010 11:46:46 AM
Platinum Customer Platinum Customer

Joined: 7/16/2009
Posts: 411
Kuf, if you wish, you may disable user access to registries. I found an alternative, and I am not using registries anymore.
Thank you
Kuf
Posted : Monday, February 1, 2010 3:07:42 PM


Administration

Joined: 9/18/2004
Posts: 3,522
Registries are disabled going forward.

The next build will also add the ability to get price data for any symbol from any time frame from within your RealCode.

I'm looking into how feesable it is to move the shared hash object into a global domain.

Ken Gilb (Kuf)
Chief Software Engineer - Worden Brothers Inc.
Try/Catch - My RealCode Blog
Flash99
Posted : Monday, February 1, 2010 3:23:00 PM
Platinum Customer Platinum Customer

Joined: 7/16/2009
Posts: 411
QUOTE (Kuf)
Registries are disabled going forward.

The next build will also add the ability to get price data for any symbol from any time frame from within your RealCode.

I'm looking into how feesable it is to move the shared hash object into a global domain.


Kuf,
I understand your reticence regarding global objects, for you and support team this would be like opening a Pandorra box inside SF5.
You mentioned you will open IO. It would be great if you could do it right away, because this could be an  alternative. I could read/write to an xml, and because the number of stocks I have is relatively low, reading/writing every few minutes should not impact the performance.
Of course, if possible, I would like to have access to a global Microsoft.VisualBasic.Collection
Thank you
Kuf
Posted : Tuesday, February 2, 2010 9:57:32 AM


Administration

Joined: 9/18/2004
Posts: 3,522
Build 176 will have a global shared hash. It will also have new syntax for the Lock, Unlock, WaitForUnlock methods.

Ken Gilb (Kuf)
Chief Software Engineer - Worden Brothers Inc.
Try/Catch - My RealCode Blog
Kuf
Posted : Tuesday, February 2, 2010 4:12:22 PM


Administration

Joined: 9/18/2004
Posts: 3,522

Build 176 will be changing the lock/unlock/waitforulnock syntax.    The lock/unlock syntax implies that it's required, and it's not.  The new syntax will be: NotifyDataChanging (lock), NotifyDataReady (unlock), WaitForDataReady (WaitForUnlock). These calls only need to be used in a publisher/subscriber model where the subscriber wants to wait for the publisher to finish creating the data.

As of build 176 setSharedHashValue is now global across all charts/conditions/scans etc.

'Publisher

If isFirstBar Then
    Me.NotifyDataChanging("MyUniqueKey")
End If

plot = price.value

If isLastBar Then
    Me.setSharedHashValue("MyUniqueKey", price.value)
    Me.NotifyDataReady("MyUniqueKey")
End If


' Subscriber


Static sharedData As Single
If isFirstBar Then
    sharedData = 0
    If Me.WaitForDataReady("MyUniqueKey", 1000) Then
        shareddata = Me.getSharedHashValue("MyUniqueKey")
    End If
End If

plot = sharedData



Ken Gilb (Kuf)
Chief Software Engineer - Worden Brothers Inc.
Try/Catch - My RealCode Blog
Flash99
Posted : Wednesday, February 3, 2010 2:40:34 PM
Platinum Customer Platinum Customer

Joined: 7/16/2009
Posts: 411
QUOTE (Kuf)
You can put any collection you want in the key/value pairs.


I just tried it in the build 176 and I cannot set a collection with setSharedHashValue. Obviously I am missing something. The compiler error says "Value of type '"System....." cannot be converted to "String".

This is my code.

Public partial Class RealCodeCondition
inherits RealCodeCondition_base
    Public Overrides Sub CallUserCode()
'|*****************************************************************|
'|*** StockFinder RealCode Condition - Version 4.9 www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Condition:set hash
'|******************************************************************
Dim myTestCollection As system.Collections.Generic.List(Of HorizontalLine)

Dim item As New HorizontalLine()
item.symbol = "MSFT"
item.price = 20.00
item.message = "message for MSFT"

myTestCollection.Add(item)

Me.setSharedHashValue("myTest", myTestCollection)

end sub
   
    Public Structure HorizontalLine
        Public symbol As String
        Public price As Single
        Public message As String
    End Structure

End Class
Kuf
Posted : Thursday, February 4, 2010 8:25:26 AM


Administration

Joined: 9/18/2004
Posts: 3,522
Oops! Your code is fine, setSharedHashValue has the wrong parameter type.

Ken Gilb (Kuf)
Chief Software Engineer - Worden Brothers Inc.
Try/Catch - My RealCode Blog
pthegreat
Posted : Wednesday, February 2, 2011 7:11:28 PM

Registered User
Joined: 6/15/2008
Posts: 1,356
I barely understand about 50% of what you guys talkign about, so enough to be dangerous.

has there been any new developments since February '10 ? Is the chapter on global variables in the 2nd edition realcode manual still valid?
with my little realcode experience, and if I interpret things correctly, I think this could help me in certain circumstances.
For example I have some indicators, that draw trendlines, and price projections. I'd like to create some conditions, but I don't see another way to do this by eiher duplicating the code, or somehow be able to share variables between the indicator and a condition. 

Kuff, or any of the experienced coders, could you post some simple examples, and explain in laymen terms how it works? Once I understand the "do's" and "don'ts", I think I'll be able to implement it in my layouts.
Flash99
Posted : Monday, February 14, 2011 10:05:49 PM
Platinum Customer Platinum Customer

Joined: 7/16/2009
Posts: 411
QUOTE (pthegreat)
I barely understand about 50% of what you guys talkign about, so enough to be dangerous.

has there been any new developments since February '10 ? Is the chapter on global variables in the 2nd edition realcode manual still valid?
with my little realcode experience, and if I interpret things correctly, I think this could help me in certain circumstances.
For example I have some indicators, that draw trendlines, and price projections. I'd like to create some conditions, but I don't see another way to do this by eiher duplicating the code, or somehow be able to share variables between the indicator and a condition. 

Kuff, or any of the experienced coders, could you post some simple examples, and explain in laymen terms how it works? Once I understand the "do's" and "don'ts", I think I'll be able to implement it in my layouts.

Hi pthegreat,
The shared object is nothing but a repository of data that you can share at the application level =>
Condition 1: you store data in the shared object (memory)
Condition 2: you retrieve the data from the shared object and use it as you want.

I think the best way to explain it, is to describe how I use it:
1. Global variable (apllication level)
a. list of holidays in the last 12 months
b. application settings (SP-500 is close to a strong support or resistance level, I strongly suspect a reversal will happen => I am interested mostly in reversal/topping signals, so in this case I set a list of signals in the shared object , and then my signals get triggered only if they are in the list - only reversal/topping signals).
2. Share data between different time frames 
a. let's say I am in a 5 minutes timeframe, the last bar is an oversold hammer. It would be very interesting to know that this hammer happens exactly at the intersection with a rising Bollinger Band bottom from a 60 minutes time frame. The shared object allows you to make this determination, all you need is another condition from a 60mins timeframe that stores the data in the shared object which then you can read in your 5mins timeframe condition.
b. or you can have an overbought  shooting star candle in a 5mins timeframe, but the stock is in a strong daily downtrend; and the price is very close to the MA20 from the daily timeframe.

There is nothing special about the code. See code sample from previous postings. It's just a matter of storing/retrieving the data. The interesting part is what you store and how you use it.
So far, the shared object worked without a glitch for me. No locking necessary. It's beautiful.
Hope it helps
pthegreat
Posted : Sunday, February 17, 2013 11:59:52 PM

Registered User
Joined: 6/15/2008
Posts: 1,356

Hi Flash/kuf, and/or other experienced coders,

could you give your input on the issue I'm describing at http://forums.worden.com/default.aspx?g=posts&t=58347

My knowledge of using subs/classes is limited. my understanding of subroutines is that they are pieces of code that are being called from a main routine in order to avoid unnecessary repetition of code. is the sharedhasvalue used to port data back/forth between a main class and subroutines, or is this done another way?? or between multiple indicators/conditions?

if someone could reply in the above thread, I would appreciate it very much.

 

Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.