Arizona, USA
Experience: Intermediate
Platform: NinjaTrader
Broker: MB Trading
Trading: Cello
Posts: 116 since Jan 2011
Thanks Given: 321
Thanks Received: 138
|
Okay, I know so few programming terms, I do not even know the right question to ask. I'm writing various strategies, and calling indicators with lots of inputs it tedious, and looks messy. Drives me nuts. I like clean code - helps me think.
As I said, I don't know enough terms to search for an answer. I've done this in other languages (Pascal and Ada), (I know! I know! I honestly don't know much about programming). Can I do this in C#/Ninja?
--------------------------------------------------------------
What I have now:
// Inside some strategy
if (CrossAbove(MyIndicatorA(Input, CoefficientA, CoefficientB, AnotherCoefficient, YetAnother).Value,
MyIndicatorB(Input, CoefficientA, CoefficientB, AnotherCoefficient, YetAnother).Value),1)
{
DoStuff ();
}
--------------------------------------------------------------
What I want to do:
protected DataSeries GetIndicatorA ()
{
return (MyIndicatorA(Input, CoefficientA, CoefficientB, AnotherCoefficient, YetAnother).Value);
}
protected DataSeries GetIndicatorB ()
{
return (MyIndicatorB(Input, CoefficientA, CoefficientB, AnotherCoefficient, YetAnother).Value);
}
if (CrossAbove(GetIndicatorA, GetIndicatorB),1)
{
DoStuff ();
}
Make sense?
|