Simple strategy - futures io
futures io futures trading



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 4,977 views
    2. thumb_up 3 thanks given
    3. group 5 followers
    1. forum 19 posts
    2. attach_file 1 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
 

Simple strategy

(login for full post details)
  #1 (permalink)
Australia
 
Experience: Intermediate
Platform: Ninja
 
vast's Avatar
 
Posts: 167 since Jun 2009
Thanks: 154 given, 62 received

I am needing some help with getting an order to enter once a doublema changes from falling to rising.
I have tried several things, but can't get it to work at the correct spots.
I just need help with the entry trigger. When DoubleMA changes from falling to rising (it changes colour anyway) I would like to enter a long.
I would like to only take one trade per change from falling to rising as well.

As it is not crossing over anything, I am confused.
Thanks in advance
Regards

Started this thread Reply With Quote

Journal Challenge February 2021 results (so far):
Competing for $1500 in prizes from Topstep
looks_oneSBtrader82 's Trading Journalby SBtrader82
(170 thanks from 31 posts)
looks_twoJust BEING a Trader: Letting Go!!by iqgod
(116 thanks from 33 posts)
looks_3Wisdom is Emptinessby Mtype
(68 thanks from 25 posts)
looks_4Deetee’s DAX Trading Journal (time based)by Deetee
(31 thanks from 17 posts)
looks_5Journal for peanuts1956by peanuts1956
(23 thanks from 13 posts)
 
 
(login for full post details)
  #2 (permalink)
Frankfurt
 
Experience: Intermediate
Platform: NinjaTrader
Trading: FGBL 6E B4
 
max-td's Avatar
 
Posts: 1,754 since Jun 2009
Thanks: 2,309 given, 924 received

ok - lets see ....

first of all - i dont like these big indicator-codes like the DMA-stuff in strategys - thats why the first step would be to create a new small indicator or reducing it to an easy formular (without all color+parameter-things) wich hits what i needs -- example :

ZeroLagEMA(ZeroLagEMA(period), period)

than as condition a would try this :

if
ZeroLagEMA(ZeroLagEMA(period), period) [0] > ZeroLagEMA(ZeroLagEMA(period), period) [1]

... do something

if
ZeroLagEMA(ZeroLagEMA(16), 16) [0] > ZeroLagEMA(ZeroLagEMA(16), 16) [1]

... ENTER long ...

If this easy thing does what you want, you can go on + add more conditions
thats my why of building up + testing conditions.

max-td
Reply With Quote
 
(login for full post details)
  #3 (permalink)
Australia
 
Experience: Intermediate
Platform: Ninja
 
vast's Avatar
 
Posts: 167 since Jun 2009
Thanks: 154 given, 62 received


OK. Thanks. Will give it a go

Started this thread Reply With Quote
 
(login for full post details)
  #4 (permalink)
Frankfurt
 
Experience: Intermediate
Platform: NinjaTrader
Trading: FGBL 6E B4
 
max-td's Avatar
 
Posts: 1,754 since Jun 2009
Thanks: 2,309 given, 924 received

also - depending on the instrument - i sometimes use to make a rounding of the indicator-values i compare to eachother in my conditions.

max-td
Reply With Quote
 
(login for full post details)
  #5 (permalink)
Australia
 
Experience: Intermediate
Platform: Ninja
 
vast's Avatar
 
Posts: 167 since Jun 2009
Thanks: 154 given, 62 received

Mike,
I am wondering how I can use this information in a strategy please.
I am a real novice when it comes to C#.
"I released a newer version of DoubleMA with more moving averages and a Signal dataseries (0 neutral, -1 short, 1 long).
Could you please provide an example?
ie: if
(DoubleMA(45,NinjaTrader.Indicator.DoubleMA_internal.DMAType.EMA,45,NinjaTrader.Indicator.DoubleMA_internal.DMAType.EMA).signal[1]

Enter long?

Started this thread Reply With Quote
 
(login for full post details)
  #6 (permalink)
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
 
Big Mike's Avatar
 
Posts: 49,753 since Jun 2009
Thanks: 32,299 given, 97,506 received


vast View Post
Mike,
I am wondering how I can use this information in a strategy please.
I am a real novice when it comes to C#.
"I released a newer version of DoubleMA with more moving averages and a Signal dataseries (0 neutral, -1 short, 1 long).
Could you please provide an example?
ie: if
(DoubleMA(45,NinjaTrader.Indicator.DoubleMA_internal.DMAType.EMA,45,NinjaTrader.Indicator.DoubleMA_internal.DMAType.EMA).signal[1]

Enter long?

This looks right, I am not sure I understand what is not working for you.

Signal dataseries:
1 == rising
0 == neutral
-1 == falling

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

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
The following user says Thank You to Big Mike for this post:
 
(login for full post details)
  #7 (permalink)
Australia
 
Experience: Intermediate
Platform: Ninja
 
vast's Avatar
 
Posts: 167 since Jun 2009
Thanks: 154 given, 62 received

Thanks Mike.
I tried it and it ame me an error of:Cannot implicitly convert type 'double' to 'bool'
So I tried this:
if (DoubleMA(30,NinjaTrader.Indicator.DoubleMA_internal.DMAType.ZeroLagEMA,30,NinjaTrader.Indicator.DoubleMA_internal.DMAType.ZeroLagEMA).Signal[1] > DoubleMA(30,NinjaTrader.Indicator.DoubleMA_internal.DMAType.ZeroLagEMA,30,NinjaTrader.Indicator.DoubleMA_internal.DMAType.ZeroLagEMA).Signal[-1])
{
EnterLongLimit(DefaultQuantity, GetCurrentAsk(), "Long");
}
It compiled but doesn't work.
All I am trying to do it enter a long after the DMA goes from falling to rising. I must be dumb.
Sorry

Started this thread Reply With Quote
 
(login for full post details)
  #8 (permalink)
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
 
Big Mike's Avatar
 
Posts: 49,753 since Jun 2009
Thanks: 32,299 given, 97,506 received

Ok, here is the issue

Signal[x] where x=number of bars ago. 0 means current bar that just closed, 10 means 10 bars ago, 100 means 100 bars ago. That is basic NT.

What you need to do is change the end of your string to:

Signal[0] == -1) (this represents a short, for a long change to Signal[0] == 1)

Mike

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #9 (permalink)
Australia
 
Experience: Intermediate
Platform: Ninja
 
vast's Avatar
 
Posts: 167 since Jun 2009
Thanks: 154 given, 62 received

Thank you. Sorry for hassle. At least I am giving it a go.
I have a lot to learn.

Started this thread Reply With Quote
 
(login for full post details)
  #10 (permalink)
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
 
Big Mike's Avatar
 
Posts: 49,753 since Jun 2009
Thanks: 32,299 given, 97,506 received



vast View Post
Thank you. Sorry for hassle. At least I am giving it a go.
I have a lot to learn.

No hassle at all. I had some "duh" moments when I learned it as well.

Mike

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #11 (permalink)
Australia
 
Experience: Intermediate
Platform: Ninja
 
vast's Avatar
 
Posts: 167 since Jun 2009
Thanks: 154 given, 62 received

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
 
(login for full post details)
  #12 (permalink)
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
 
Big Mike's Avatar
 
Posts: 49,753 since Jun 2009
Thanks: 32,299 given, 97,506 received

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

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #13 (permalink)
Australia
 
Experience: Intermediate
Platform: Ninja
 
vast's Avatar
 
Posts: 167 since Jun 2009
Thanks: 154 given, 62 received

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
 
(login for full post details)
  #14 (permalink)
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
 
Big Mike's Avatar
 
Posts: 49,753 since Jun 2009
Thanks: 32,299 given, 97,506 received


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

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #15 (permalink)
Australia
 
Experience: Intermediate
Platform: Ninja
 
vast's Avatar
 
Posts: 167 since Jun 2009
Thanks: 154 given, 62 received

Ok. Thanks.

Started this thread Reply With Quote
 
(login for full post details)
  #16 (permalink)
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
 
Big Mike's Avatar
 
Posts: 49,753 since Jun 2009
Thanks: 32,299 given, 97,506 received

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

Mike

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #17 (permalink)
Site Moderator
 
 
sam028's Avatar
 
Posts: 3,665 since Jun 2009
Thanks: 3,786 given, 4,494 received

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
Register to download File Type: cs ZeroZero.cs (21.4 KB, 38 views)
Follow me on Twitter Reply With Quote
The following user says Thank You to sam028 for this post:
 
(login for full post details)
  #18 (permalink)
Australia
 
Experience: Intermediate
Platform: Ninja
 
vast's Avatar
 
Posts: 167 since Jun 2009
Thanks: 154 given, 62 received

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
 
(login for full post details)
  #19 (permalink)
Bentiem
 
 
Posts: 4 since Jun 2010
Thanks: 3 given, 1 received

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
The following user says Thank You to Victor 10 for this post:
 
(login for full post details)
  #20 (permalink)
Near the BEuTiFULL Horse Shoe
 
Experience: Beginner
Platform: NinjaTrader
Broker: MBTrading Dukascopy ZenFire
Trading: $EURUSD when it is trending
 
Trader.Jon's Avatar
 
Posts: 500 since Jul 2009
Thanks: 401 given, 183 received


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


futures io Trading Community Platforms and Indicators NinjaTrader > Simple strategy


Last Updated on August 5, 2010


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Journal Challenge w/$1500 prizes from Topstep!

February
 

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

March
 

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

Elite only
     



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