How to use multi inherit?
Hi guys,
I'm new in PTMC programming and I'm trying to separate some logic in my strategy, like risk, position management and strategy. But in the subclasses I can't get the values from the chart, bars, indicators, etc.
For example, the main class is:
public class MyTrading : NETStrategy
{
...
CPosition position = new CPosition();
double askValue = position.
GetQuoteAsk()
;
...
}
this is the class to manage the position:
class CPosition
: NETStrategy
{
...
public double GetQuoteAsk()
{
Quote lastQuote = Instruments.Current.LastQuote;
if (lastQuote == null)
return 0;
return lastQuote.Ask;
}
...
}
if I try to get some value from "position", as shown above, I always get null for "lastQuote".
Which is the right approach?
Thanks in advance
No replies yet
Join PTMC community to post your replies on forum