| -
How to create a simple function and access it from indicators
I know how to create functions (methods) in C#; I know how to use Strategy Trader to create functions. Unfortunately, they don't look very much alike and I can't find an explanation within the limited documentation available.
What is the point of class constructors like:
public Average(BaseTechniqueService ctx, int data_stream) :
base(ctx, data_stream) { m_datastream = data_stream; }
I know it is a class constructor, but what are BaseTechniqueService and data_stream for?
To clarify my need a bit. I want to create a function that accepts three double values and returns a double result. It is simple and straight forward in standard C#. How is it done in Strategy Trader?
public double CalcMyNumbers(double x, double y, double z)
{
double calcdResult = x - y / z;
return calcdResult
}
Can anyone explain how to do this?
-
Data Stream and ctx
It is my understanding that the "ctx" statement when used with the overload "data_stream" is for strategies, functions and indicators that utilize multiple timeframes. Therefore, if you have two (or more) time frames then the first "ctx" statement does not require the "data_stream" overload, but all other time frames do require a separate "ctx" statement and they all have to be given the "data_stream" overload for each separate time frame.
-
RE: How to create a simple function and access it from indicators
Thanks for the clarification. I guess that means a basic function such as I described in my op doesn't actually need the ctx or datastream info.
|
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
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.