NexusFi: Find Your Edge


Home Menu

 





Simple strategy


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one vast with 9 posts (0 thanks)
    2. looks_two Big Mike with 6 posts (1 thanks)
    3. looks_3 max-td with 2 posts (0 thanks)
    4. looks_4 Trader.Jon with 1 posts (0 thanks)
    1. trending_up 6,953 views
    2. thumb_up 3 thanks given
    3. group 5 followers
    1. forum 19 posts
    2. attach_file 1 attachments




 
Search this Thread

Simple strategy

  #11 (permalink)
 
vast's Avatar
 vast 
Australia
 
Experience: Intermediate
Platform: Ninja
Posts: 167 since Jun 2009
Thanks Given: 154
Thanks Received: 62

I get a lot of trades though. I was hoping for one trade each time the DMA changes from falling to rising.
Here is a screen shot. 2009-07-22_1919

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Quantum physics & Trading dynamics
The Elite Circle
REcommedations for programming help
Sierra Chart
MC PL editor upgrade
MultiCharts
ZombieSqueeze
Platforms and Indicators
 
  #12 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,469 since Jun 2009
Thanks Given: 33,246
Thanks Received: 101,669

Is because you are only asking if it is Signal[0] == 1. That means if long.

What you need to do is add a second if statement that checks the prior bar, such as Signal[1] != 1.

This means if bar 1 is not equal to 1, and bar 0 is equal to 1, then that means it changed and go long.

 
Code
if (DoubleMA(30,NinjaTrader.Indicator.DoubleMA_internal.DMAType.ZeroLagEMA,30,NinjaTrader.Indicator.DoubleMA_internal.DMAType.ZeroLagEMA).Signal[0] == 1)

if (DoubleMA(30,NinjaTrader.Indicator.DoubleMA_internal.DMAType.ZeroLagEMA,30,NinjaTrader.Indicator.DoubleMA_internal.DMAType.ZeroLagEMA).Signal[1] != 1)

{
                EnterLongLimit(DefaultQuantity, GetCurrentAsk(), "Long");
            }
Mike



Join the free Markets Chat beta: one platform, all the trade rooms!

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #13 (permalink)
 
vast's Avatar
 vast 
Australia
 
Experience: Intermediate
Platform: Ninja
Posts: 167 since Jun 2009
Thanks Given: 154
Thanks Received: 62


It seems to be not lining up with the DMA. Is that because the DMA paints back 2 bars?
2009-07-22_1924

Started this thread Reply With Quote
  #14 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,469 since Jun 2009
Thanks Given: 33,246
Thanks Received: 101,669


vast View Post
It seems to be not lining up with the DMA. Is that because the DMA paints back 2 bars?
2009-07-22_1924

There is a whole thread about DMA and signal issues. (I think this is it, not sure). I personally don't use it so can't comment. You might try using the DMV dataseries and see if it works any better for you. DMV returns the value not a signal, so you need to use Rising or Falling:

 
Code
if (Rising(DoubleMA(30,NinjaTrader.Indicator.DoubleMA_internal.DMAType.ZeroLagEMA,30,NinjaTrader.Indicator.DoubleMA_internal.DMAType.ZeroLagEMA).DMV))
Also as mentioned earlier by max-td here you might eliminate DoubleMA and do it his way. Although honestly, I've not tested this and am not sure if it produces the same results as DoubleMA.

Mike



Join the free Markets Chat beta: one platform, all the trade rooms!

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #15 (permalink)
 
vast's Avatar
 vast 
Australia
 
Experience: Intermediate
Platform: Ninja
Posts: 167 since Jun 2009
Thanks Given: 154
Thanks Received: 62

Ok. Thanks.

Started this thread Reply With Quote
  #16 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,469 since Jun 2009
Thanks Given: 33,246
Thanks Received: 101,669

I fixed this post, I didn't realize some extra code was in there until now.

Mike



Join the free Markets Chat beta: one platform, all the trade rooms!

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #17 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629

Vast, here is a basic strategy, made with the wizard in about 30 seconds, without using DoubleMA but only ZeroLagEMA.
Maybe it can help.

Attached Files
Elite Membership required to download: ZeroZero.cs
Follow me on Twitter Reply With Quote
Thanked by:
  #18 (permalink)
 
vast's Avatar
 vast 
Australia
 
Experience: Intermediate
Platform: Ninja
Posts: 167 since Jun 2009
Thanks Given: 154
Thanks Received: 62

Thanks Sam.
I guess I was hoping that I could build a strategy on the DMA and other indicators. I had hoped to use the change of colour as a reference point. ie. When the DMA turns from falling to rising is changes colour.
Anyway, it seems to be not possible. The entries are too slow.
Regards

Started this thread Reply With Quote
  #19 (permalink)
Victor 10
Bentiem
 
Posts: 4 since Jun 2010
Thanks Given: 3
Thanks Received: 1

Thanks BigMike
after 2 weeks HERE is the answer .... "Keep in mind if you use the wizard it places + sign instead of . in a couple of places, you need to manually change it, but your string above seems fine.

Mike "
i replaced the'+' with a '.' and now it will compile!!
Vic10

Reply With Quote
Thanked by:
  #20 (permalink)
 
Trader.Jon's Avatar
 Trader.Jon 
Near the BEuTiFULL Horse Shoe
 
Experience: Beginner
Platform: NinjaTrader
Broker: MBTrading Dukascopy ZenFire
Trading: $EURUSD when it is trending
Posts: 473 since Jul 2009
Thanks Given: 401
Thanks Received: 184



vast View Post
Thanks Sam.
I guess I was hoping that I could build a strategy on the DMA and other indicators. I had hoped to use the change of colour as a reference point. ie. When the DMA turns from falling to rising is changes colour.
Anyway, it seems to be not possible. The entries are too slow.
Regards

Have a look at the Aardvark strategy that nano posted recently in the elite section .. lots of good code to help you out

Reply With Quote




Last Updated on August 5, 2010


© 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