NexusFi: Find Your Edge


Home Menu

 





Calling Indicator in Wrapper Function?


Discussion in NinjaTrader

Updated
    1. trending_up 2,233 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 2 posts
    2. attach_file 0 attachments




 
Search this Thread

Calling Indicator in Wrapper Function?

  #1 (permalink)
 
serac's Avatar
 serac 
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?

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Better Renko Gaps
The Elite Circle
Exit Strategy
NinjaTrader
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Trade idea based off three indicators.
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Just another trading journal: PA, Wyckoff & Trends
25 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
21 thanks
GFIs1 1 DAX trade per day journal
16 thanks
  #3 (permalink)
 
Trader.Jon's Avatar
 Trader.Jon 
Near the BEuTiFULL Horse Shoe
 
Experience: Beginner
Platform: NinjaTrader
Broker: MBTrading Dukascopy ZenFire
Trading: $EURUSD when it is trending
Posts: 473 since Jul 2009
Thanks Given: 401
Thanks Received: 184


That looks doable ... have a look at the sample strategies in the downloads


There are better ones in the Elite downloads !


TJ

Reply With Quote




Last Updated on February 9, 2011


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts