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 bltdavid with 1 posts (0 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 2,542 views
    2. thumb_up 4 thanks given
    3. group 4 followers
    1. forum 10 posts
    2. attach_file 0 attachments




 
Search this Thread

Indicator to Strategy HELP!

  #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:

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
MC PL editor upgrade
MultiCharts
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
REcommedations for programming help
Sierra Chart
Better Renko Gaps
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
41 thanks
Just another trading journal: PA, Wyckoff & Trends
30 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
23 thanks
GFIs1 1 DAX trade per day journal
21 thanks




Last Updated on October 26, 2015


© 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