NexusFi: Find Your Edge


Home Menu

 





Indicator to Strategy HELP!


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one kidvic with 4 posts (0 thanks)
    2. looks_two trendwaves with 3 posts (4 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 MichaelH with 1 posts (0 thanks)
    1. trending_up 4,382 views
    2. thumb_up 4 thanks given
    3. group 4 followers
    1. forum 10 posts
    2. attach_file 0 attachments




 
Search this Thread
  #11 (permalink)
 
trendwaves's Avatar
 trendwaves 
Florida
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader 8
Trading: ES, NQ, CL
Posts: 703 since Dec 2012
Thanks Given: 2,898
Thanks Received: 2,525


kidvic View Post
This script exists inside an indicator, if I create a strategy how do I link it?

The values of C and TV would need to be made public in the properties section of the indicator file. Then you would reference those properties from within the strategy...

So in your indicator properties you might have something like this...

 
Code
        #region Properties

        [Browsable(false)]
        [XmlIgnore()]
        public bool C
        {
            get { return Values[0]; }
        }

        [Browsable(false)]
        [XmlIgnore()]
        public double TV
        {
            get { return Values[1]; }
        }
				
       #endregion

Then in your strategy you can access those values like this (where XYZ() is the name of your indicator)....

 
Code
if (XYZ().C[0])
{
     EnterShortLimit(DefaultQuantity, XYZ().TV[0], "ShortEntry");
     SetStopLoss("ShortEntry", CalculationMode.Ticks, StopLossOffsetTicks, false);
     SetProfitTarget("ShortEntry", CalculationMode.Ticks, ProfitTargetTicks);
}


Be Patient and Trade Smart
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:




Last Updated on October 26, 2015


© 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