NexusFi: Find Your Edge


Home Menu

 





Would like help programming this in Ninja Ver 8


Discussion in NinjaTrader

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




 
Search this Thread

Would like help programming this in Ninja Ver 8

  #1 (permalink)
 poipoi11 
Atlanta, Georgia
 
Experience: Intermediate
Platform: Ninjatrader
Trading: Futures
Posts: 2 since Jul 2011
Thanks Given: 1
Thanks Received: 0

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

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
REcommedations for programming help
Sierra Chart
Trade idea based off three indicators.
Traders Hideout
Better Renko Gaps
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
34 thanks
Tao te Trade: way of the WLD
24 thanks
My NQ Trading Journal
14 thanks
Vinny E-Mini & Algobox Review TRADE ROOM
13 thanks
GFIs1 1 DAX trade per day journal
11 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


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 NexusFi Trade Journal Reply With Quote
Thanked by:
  #4 (permalink)
 poipoi11 
Atlanta, Georgia
 
Experience: Intermediate
Platform: Ninjatrader
Trading: Futures
Posts: 2 since Jul 2011
Thanks Given: 1
Thanks Received: 0

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
Elite Membership required to download: @@@MomentumAuto_2017_01_25_0.cs
Elite Membership required to download: @@@MomentumAuto_2017_01_25_01.xml
Started this thread Reply With Quote




Last Updated on January 25, 2017


© 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