NexusFi: Find Your Edge


Home Menu

 





Calling Indicator in Wrapper Function?


Discussion in NinjaTrader

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




 
Search this Thread
  #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?
Netherlands & Germany Surge as World Cup Field Narro …
Prediction Markets & Event Contracts
CME Launches Bitcoin Volatility Futures June 1 -- First …
Cryptocurrency
The June 15 Resolution Trap: Irans Agreed Text Still Pri …
Prediction Markets & Event Contracts
Rubios Good News Within Hours and the 30-Day Math: Why H …
Prediction Markets & Event Contracts
S&P 500 Holds the Line: No Fast Track for SpaceX, Op …
Stocks and ETFs
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
8 thanks
Darmok and Jalad at Tanagra
1 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
https://nexusfi.com/free_downloads/ninjatrader-7/strategies/820-download.html?view

There are better ones in the Elite downloads !
https://nexusfi.com/free_downloads/vip_elite_circle/692-download.html?view

TJ


Reply With Quote




Last Updated on February 9, 2011


© 2026 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 - Downloads - Top
no new posts