Calling Indicator in Wrapper Function? - NinjaTrader Programming | futures trading

Go Back

> Futures Trading, News, Charts and Platforms > Platforms and Indicators > NinjaTrader > NinjaTrader Programming

Calling Indicator in Wrapper Function?
Started:February 9th, 2011 (03:47 PM) by serac Views / Replies:1,226 / 2
Last Reply:February 9th, 2011 (03:54 PM) Attachments:0

Welcome to

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community. It's free and simple, and we will never resell your private information.

-- Big Mike

Thread Tools Search this Thread

Calling Indicator in Wrapper Function?

Old February 9th, 2011, 03:47 PM   #1 (permalink)
Elite Member
Arizona, USA
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: MB Trading
Favorite Futures: Cello
serac's Avatar
Posts: 116 since Jan 2011
Thanks: 321 given, 135 received

Calling Indicator in Wrapper Function?

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?

Reply With Quote

Old February 9th, 2011, 03:47 PM   #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.


Old February 9th, 2011, 03:54 PM   #3 (permalink)
Elite Member
Near the BEuTiFULL Horse Shoe
Futures Experience: Beginner
Platform: NinjaTrader
Broker/Data: MBTrading Dukascopy ZenFire
Favorite Futures: $EURUSD when it is trending
Trader.Jon's Avatar
Posts: 500 since Jul 2009
Thanks: 401 given, 172 received

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

There are better ones in the Elite downloads !


Last edited by Trader.Jon; February 10th, 2011 at 12:47 AM.
Reply With Quote

Reply > Futures Trading, News, Charts and Platforms > Platforms and Indicators > NinjaTrader > NinjaTrader Programming > Calling Indicator in Wrapper Function?

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Upcoming Webinars and Events (4:30PM ET unless noted)

NinjaTrader 8: Programming Profitable Trading Edges w/Scott Hodson

Elite only

Anthony Drager: Executing on Intermarket Correlations & Order Flow, Part 2

Elite only

Adam Grimes: Five critically important keys to professional trading

Elite only

Machine Learning Concepts w/FIO member NJAMC

Elite only

MarketDelta Cloud Platform: Announcing new mobile features

Dec 1

NinjaTrader 8: Features and Enhancements

Dec 6

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling an Optimization in a Strategy serac NinjaTrader Programming 17 September 2nd, 2015 02:25 PM
Add Background Color function to an indicator michaelf NinjaTrader Programming 33 October 15th, 2014 05:34 PM
Help requested for MESA MAMA FAMA indicator function gpw797 EasyLanguage Programming 21 October 7th, 2014 12:11 PM
Gold - I'm calling the top cpi65 Commodities Futures Trading 65 February 19th, 2012 04:32 AM
Calling GomiCD into GomiLadder kashter NinjaTrader Programming 2 May 9th, 2011 06:35 PM

All times are GMT -4. The time now is 11:01 AM.

Copyright © 2016 by 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.
no new posts

Page generated 2016-10-27 in 0.07 seconds with 19 queries on phoenix via your IP