NexusFi: Find Your Edge


Home Menu

 





Indicator to strategy best practices


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one trendwaves with 1 posts (1 thanks)
    2. looks_two AA Ron with 1 posts (0 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 Maza with 1 posts (1 thanks)
    1. trending_up 1,667 views
    2. thumb_up 2 thanks given
    3. group 3 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
AA Ron
denver, colorado
 
Posts: 4 since Oct 2015
Thanks Given: 8
Thanks Received: 0

Hi all. I've recently completed my first usable custom indicator with NT7. I now want to connect this to a strategy, mostly so I can easily back test the success rate of the indicator. The indicator currently draws a vertical green line to show when buy criteria are met, and a vertical red line when sell criteria are met. Using the following code:

DrawVerticalLine("GoingShort "+ CurrentBar, 0, Color.Red);

When I attempt to implement this into a strategy it doesn't notice the vertical lines exist. Based on experience what is the best way to augment the code so that it will also send a usable buy signal to a strategy?


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Would a node-based workflow for automated trading be useful?
Traders Hideout
Bookmap Global Plus Lifetime + Lifetime Addons For Sale
Platforms and Indicators
S&P 500 Holds the Line: No Fast Track for SpaceX, Op …
Stocks and ETFs
Khamenei Vetoes Uranium Transfer as Peace Odds Surge to …
Prediction Markets & Event Contracts
May 26 Deadline Dies at 7.5% as US Strikes Iran During C …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
10 thanks
Darmok and Jalad at Tanagra
3 thanks
Big Mike in Ecuador
1 thanks
30 Sessions
1 thanks
  #3 (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



AA Ron View Post
Hi all. I've recently completed my first usable custom indicator with NT7. I now want to connect this to a strategy, mostly so I can easily back test the success rate of the indicator. The indicator currently draws a vertical green line to show when buy criteria are met, and a vertical red line when sell criteria are met. Using the following code:

DrawVerticalLine("GoingShort "+ CurrentBar, 0, Color.Red);

When I attempt to implement this into a strategy it doesn't notice the vertical lines exist. Based on experience what is the best way to augment the code so that it will also send a usable buy signal to a strategy?

One way is to set a public boolean in your indicator at the time it draws the vertical line which your strategy would then use to know when to place the appropriate buy or sell order.


Be Patient and Trade Smart
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #4 (permalink)
 Maza 
Cluj-Napoca Cluj/Romania
 
Experience: Intermediate
Platform: NinjaTrader, MetaTrader 4
Broker: FXCM, Continuum
Trading: Forex, Futures
Posts: 12 since Apr 2013
Thanks Given: 6
Thanks Received: 7


trendwaves View Post
One way is to set a public boolean in your indicator at the time it draws the vertical line which your strategy would then use to know when to place the appropriate buy or sell order.

I use the same thing as trendwaves except I use an int, and have it set to 0 when it's neutral, then when it gets a buy I set it to a 1 and when it gets a sell signal I set it to a -1.


Reply With Quote
Thanked by:




Last Updated on January 18, 2016


© 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