Would like help programming this in Ninja Ver 8 - futures io
futures io futures trading



Would like help programming this in Ninja Ver 8


Discussion in NinjaTrader

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




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
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.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

Would like help programming this in Ninja Ver 8

(login for full post details)
  #1 (permalink)
Atlanta, Georgia
 
Experience: Intermediate
Platform: Ninjatrader
Trading: Futures
 
Posts: 2 since Jul 2011
Thanks: 1 given, 0 received

I have struggled a little trying to get this programmed correctly. I will give the rules and then also include a screenshot as well.

I would like to make this so that I can adjust and optimize the targets and stops. Everything else is well tested enough to convince me that it is a sound strategy.

For Longs:
Low[0] > SMA(50)[0] Note: Low from the current closed bar is above the 50 SMA
Close[0] > SMA(50)[0] Note: The close from the current closed bar is also greater than the 50 SMA
RSI(5,1).Ave[1] <50 Note: The RSI value from one bar ago was less than 50
RSI(5,1).Ave[0] >50 Note: The RSI value from the current closed bar is greater than 50
RSI(5,1).Ave[0] <60 Note: The RSI value of the current bar is also less than 60
Close[0] > EMA(15)[0] Note: The close of the bar is above the EMA 15 line

For Shorts:
High[0] < SMA(50)[0] Note: High from the current closed bar is below the 50 SMA
Close[0] < SMA(50)[0] Note: The close from the current closed bar is also less than the 50 SMA
RSI(5,1).Ave[1] >50 Note: The RSI value from one bar ago was more than 50
RSI(5,1).Ave[0] <50 Note: The RSI value from the current closed bar is less than 50
RSI(5,1).Ave[0] >40 Note: The RSI value of the current bar is also greater than 40
Close[0] < EMA(15)[0] Note: The close of the bar is below the EMA 15 line

The long and short entry should be one tick above the high or low of the trigger candle so that I can let price pull me into the trade.

Not sure if this needs to be created as an indicator first from which I can then trigger a trade, but I'd like to see the condition painted to the screen when the criteria is met.

Using the Wizard I am able to get the code to work on the longs but then was unable to make those entries variable on the strategy analyzer. I was also not successful in getting the condition to paint to the active screen in realtime.


Started this thread Reply With Quote

Journal Challenge February 2021 results:
Competing for $1500 in prizes from Topstep
looks_oneSBtrader82 's Trading Journalby SBtrader82
(173 thanks from 31 posts)
looks_twoJust BEING a Trader: Letting Go!!by iqgod
(120 thanks from 33 posts)
looks_3Wisdom is Emptinessby Mtype
(68 thanks from 25 posts)
looks_4Deetee’s DAX Trading Journal (time based)by Deetee
(35 thanks from 17 posts)
looks_5Journal for peanuts1956by peanuts1956
(23 thanks from 13 posts)
 
 
(login for full post details)
  #3 (permalink)
Market Wizard
Florida
 
Experience: Advanced
Platform: NinjaTrader 8
Trading: ES, NQ, CL
 
trendwaves's Avatar
 
Posts: 703 since Dec 2012
Thanks: 2,898 given, 2,515 received


If you can post your strategy code here , we should be able to sort it out for you.

Be Patient and Trade Smart
Visit my futures io Trade Journal Reply With Quote
The following 2 users say Thank You to trendwaves for this post:
 
(login for full post details)
  #4 (permalink)
Atlanta, Georgia
 
Experience: Intermediate
Platform: Ninjatrader
Trading: Futures
 
Posts: 2 since Jul 2011
Thanks: 1 given, 0 received

Hi and thank you for your willingness to give this a try.

I have attached the CS and XML files.

What I am attempting to accomplish:
1. Be able to add an additional contract with different profit and stop settings and the ability to move to break even once the first target is reached.
2. Have a constant line on the RSI plot for the '50' line.
3. Set a start and stop time for the strategy to run.
4. Be able to set the number of ticks above or below the trigger candle for trade entry. I'd like to be pulled into the trade if price goes in my desired direction. The minimum number of ticks used as a pull-in will be one but I plan to be able to optimize this to see if several ticks is best.
5. Perhaps be able to hear an audible when the condition is met for live trading.
6. Is it possible no the STOP loss to have 2 options - one based on ticks and the other based on a close above or below the trigger candle?
7. The trade would remain valid so long as the conditions are still met. At first I assumed that I would have to enter only on the next bar after the trigger candle, however I have noticed that so long as the condition is still valid then the trade will still work out one tick beyond the trigger candle. (if at any point after the initial condition is met but before being pulled into the trade, if any one of the conditions goes outside of the setup condition, then the trade should be invalidated and cancelled.

Would you let me know if it is possible to code for the trade to only be valid if the SLOPE of the EMA line is not flat and is in the direction of the trigger candle? I am not certain how best to define what the slope should be, but for certain the greatest issue with this strategy is when I get signals while the EMA slope is sideways.

Thank you very much for your assistance! The Wizard gets me close but some items I cannot figure out.

Attached Files
Register to download File Type: cs @@@MomentumAuto_2017_01_25_0.cs (183.0 KB, 11 views)
Register to download File Type: xml @@@MomentumAuto_2017_01_25_01.xml (12.1 KB, 7 views)
Started this thread Reply With Quote


futures io Trading Community Platforms and Indicators NinjaTrader > Would like help programming this in Ninja Ver 8


Last Updated on January 25, 2017


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
 

Call Option Buying: The New Pain Trade? w/Carley Garner

Elite only
 

Importance of Finding Your Own Way w/Adam Grimes

Elite only
 

New Challenge (TBD)

April
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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