MA cross Buy/Sell Strategy - need help - NinjaTrader Programming | futures io social day trading
futures io futures trading


MA cross Buy/Sell Strategy - need help
Updated: Views / Replies:3,814 / 11
Created: by SPMCC Attachments:5

Welcome to futures io.

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

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

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

Reply
 5  
 
Thread Tools Search this Thread
 

MA cross Buy/Sell Strategy - need help

  #1 (permalink)
Just starting out...
Warrenton,va
 
Futures Experience: Intermediate
Platform: NT 6.5
Broker/Data: PFG
Favorite Futures: forex, es, nq
 
Posts: 3 since Oct 2009
Thanks: 0 given, 0 received

MA cross Buy/Sell Strategy - need help

I wish i knew enough code to contribute something here. I could program in Trade Station but ninja has me scratching my head. I'm trying to build a simple strategy that can buy or short on a tick above/below an adjacent bar, when it is above or below 2 ma's. I do manually and am missing some ticks. If anyone could get me started, I'd be very grateful.

Happy trading

Reply With Quote
 
  #2 (permalink)
Elite Member
Frankfurt
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: FGBL 6E B4
 
max-td's Avatar
 
Posts: 1,754 since Jun 2009
Thanks: 2,309 given, 917 received

hi SPMCC,
i think you mean a MA-cross as entry-trigger, is this right ?
can you post us a screenshot of your chart with this setup marked to understand what you mean ?
If you dont know how to code with c#, have you tired it with the ninja strategy-wizard yet ?
have you checked the MA-cross-startegy-example that you have native in your NinjaTrader yet ?

if not, these are some good ways to start this project !

max-td

Last edited by max-td; January 28th, 2010 at 05:07 AM.
Reply With Quote
 
  #3 (permalink)
Elite Member
Palm Beach Gardens
 
Futures Experience: Intermediate
Platform: Ninja Trader
 
RBSailing's Avatar
 
Posts: 21 since Jun 2009
Thanks: 5 given, 6 received

1st step


hi SPMCC,

The first step in developing your strategy is to define your entry and exit "conditions"
From there you can develop the strategy code.

When defining your conditions you have to name what indicators you are including and the values that they must have to satisfy your condition.

If you can post the conditions I am sure we can help you develop the code.

Reply With Quote
The following user says Thank You to RBSailing for this post:
 
  #4 (permalink)
Just starting out...
Warrenton,va
 
Futures Experience: Intermediate
Platform: NT 6.5
Broker/Data: PFG
Favorite Futures: forex, es, nq
 
Posts: 3 since Oct 2009
Thanks: 0 given, 0 received

Thanks for the replies. What I do manually is wait until 2 or more MA's cross, then wait for a HH or LL. In tradeStation, for longs, I could buy on the next bar's tick above the prev H, or even let it come back a tick or 2, run my stops. But in ninja, I sort of mmade it work via Wizard - but the Wizard is a little sneaky.

Reply With Quote
 
  #5 (permalink)
Elite Member
Palm Beach Gardens
 
Futures Experience: Intermediate
Platform: Ninja Trader
 
RBSailing's Avatar
 
Posts: 21 since Jun 2009
Thanks: 5 given, 6 received

Sounds like a moving average crossover. What indicator or chart pattern are you using for confirmation? I assume you mean HH to be Higher High and LL to mean Lower Low...
There is a moving average cross over script on the NT support site. As for your HH and LL you could submit a stop entry order based on the High or Low of the current or last bar.

I would "test" this condition set carefully before I spent a lot of time coding it. I have worked with MA crossovers before and for me they were not very reliable.

Good luck and let us know how it goes.

Reply With Quote
 
  #6 (permalink)
Elite Member
Austin, TX
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: Currencies
 
hondo69's Avatar
 
Posts: 165 since Jun 2009
Thanks: 57 given, 240 received

When I've experiment with MA crossovers I've discovered two inherent problems. First, the lag built into most MA's cause issues of missing good entry points. So the trick seems to be to use the lag to your advantage. For example, combining a slow MA like SMA 50 with a faster MA like HMA 16 yields the best results.

Secondly, Ninja strategies only work "on bar close". So if you're trading out of the high of the previous bar (or bars), then you have to wait until the current bar closes. This really messes up a lot of good strategies. For example, if the previous high was 1100 and you want to go long at 1102 then you have a problem. The current bar must trade to 1102 and then close before an entry is made.

You almost have to have 2 charts that "talk to each other" to make the strategy viable. One chart would be short term and the other longer term.

Reply With Quote
 
  #7 (permalink)
Just starting out...
Warrenton,va
 
Futures Experience: Intermediate
Platform: NT 6.5
Broker/Data: PFG
Favorite Futures: forex, es, nq
 
Posts: 3 since Oct 2009
Thanks: 0 given, 0 received

Thanks. That's what I was afraid of. Yes, this strategy will not work on bar-close; it has to be intra-bar. Thanks again for the help.

Reply With Quote
 
  #8 (permalink)
Elite Member
Palm Beach Gardens
 
Futures Experience: Intermediate
Platform: Ninja Trader
 
RBSailing's Avatar
 
Posts: 21 since Jun 2009
Thanks: 5 given, 6 received

Strategies can use the OnMarketUpdate instead of OnBarUpdate.

I also have use a Stop entry order as well. When the current bar closes and my entry conditions have been met but I want to be sure the market is actually moving in the anticipated direction I will set a StopEntry order rather than a Market Order.

Reply With Quote
 
  #9 (permalink)
Elite Member
Austin, TX
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: Currencies
 
hondo69's Avatar
 
Posts: 165 since Jun 2009
Thanks: 57 given, 240 received

I've had trouble making OnMarketUpdate work with Ninja, but that could just my my system. Maybe I need to go back and see if I can get it to work properly because it would surely change my way of approaching a strategy. Especially for back testing.

When entering, I like to use a stop as a means of entering as well.

Reply With Quote
 
  #10 (permalink)
Elite Member
Florida
 
Futures Experience: Intermediate
Platform: NT7
Favorite Futures: CL, NQ, NG
 
Posts: 456 since Jun 2009
Thanks: 1,359 given, 383 received


RB and/or Hondo,

Are you using NT7? I'm still on v6.5. I looked into OnMarketUpdate and couldn't find it listed in the NT support helpguide. Or maybe I need to use a different link for current methods. If you have a link, please provide.

I've tried stop entries and may just need a little tweaking for error handling. Sometimes I've let my strat run during the night just to test operation and find that it has submitted orders that were subsequently rejected which then stopped the strat.

Do you have a sample of this portion of the code that you could share?

Thanks,

Kirk

Reply With Quote

Reply



futures io > > > > > MA cross Buy/Sell Strategy - need help

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Buy Stops / Sell Stop and ATM Strategies Baertrader NinjaTrader 9 August 21st, 2011 04:45 PM
Is it possible to show Buy/Sell strength in NT6.5? steveg NinjaTrader 1 March 15th, 2011 01:40 PM
MAMA with Buy Sell Signals and P&L ebtrader ThinkOrSwim Programming 2 December 11th, 2010 03:19 PM
[NinjaTrader]    buy sell chart jamfutures Platforms and Indicators 10 July 14th, 2010 08:36 PM
Buy/Sell in an indicator Mindset NinjaTrader Programming 11 October 8th, 2009 10:16 AM


All times are GMT -4. The time now is 10:22 PM.

Copyright © 2017 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
Page generated 2017-12-10 in 0.13 seconds with 20 queries on phoenix via your IP 54.221.73.186