DoubleMA strategy error - futures io
futures io futures trading



DoubleMA strategy error


Discussion in NinjaTrader

Updated
    1. trending_up 2,857 views
    2. thumb_up 1 thanks given
    3. group 0 followers
    1. forum 5 posts
    2. attach_file 0 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
 

DoubleMA strategy error

(login for full post details)
  #1 (permalink)
New York, NY
 
 
Posts: 142 since Dec 2009
Thanks: 41 given, 87 received

Hey All,

I'm trying to write a strategy that enters long when DoubleMA (5 HMA, 45 VMA) is rising (blue) and SuperTrend (3, VMA, 1.23, 3, ATR) is rising as well. Will short the opposite as well. NT, however, is not cooperating and I get the following error messages:

'NinjaTrader.Strategy.Strategy.TSSuperTrend(int, TSSuperTrend.Utility.MovingAverageType. double, int, TSSuperTrend.Utility.SuperTrendMode)' is a 'method' which is not valid in the given context

AND

'NinjaTrader.Indicator.Mav' is a 'type', which is not vaild in the given context

When I tried to doing this through the wizard, (DoubleMA on the left, == in the middle and "Rising" on the right OR DoubleMA rising == true OR DoubleMA > DoubleMA bars ago 1) I get this error message:

Return type of left expression 'DoubleMA' and right expression 'Boolean' do not match. You need to select a different item.

Why does Ninja hate me?

Thanks - Dave

Reply With Quote

Can you help answer these questions
from other members on futures io?
What blockvolume is visible? - order processing
NinjaTrader
Indicators for pair trading MES and M2K
Platforms and Indicators
Short Interest Ratio indicator?
ThinkOrSwim
COTbase for quant trading?
Elite Algorithmic NinjaTrader Trading
Help Needed: TOS Options Chain IV & IMPL MOVE Calcul …
ThinkOrSwim
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Battlestations: Show us your trading desks!
137 thanks
Big Mike in Ecuador
34 thanks
Want your NinjaTrader indicator created, free?
32 thanks
Saturday Morning Market Replay!
20 thanks
Selling Options on Futures?
19 thanks
 
(login for full post details)
  #2 (permalink)
Hartford, CT. USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AMP/CQG, Kinetick
Trading: RTY
 
RJay's Avatar
 
Posts: 688 since Jun 2009
Thanks: 747 given, 780 received


dsraider View Post
Hey All,

I'm trying to write a strategy that enters long when DoubleMA (5 HMA, 45 VMA) is rising (blue) and SuperTrend (3, VMA, 1.23, 3, ATR) is rising as well. Will short the opposite as well. NT, however, is not cooperating and I get the following error messages:

'NinjaTrader.Strategy.Strategy.TSSuperTrend(int, TSSuperTrend.Utility.MovingAverageType. double, int, TSSuperTrend.Utility.SuperTrendMode)' is a 'method' which is not valid in the given context

AND

'NinjaTrader.Indicator.Mav' is a 'type', which is not vaild in the given context

When I tried to doing this through the wizard, (DoubleMA on the left, == in the middle and "Rising" on the right OR DoubleMA rising == true OR DoubleMA > DoubleMA bars ago 1) I get this error message:

Return type of left expression 'DoubleMA' and right expression 'Boolean' do not match. You need to select a different item.

Why does Ninja hate me?

Thanks - Dave

Hi Dave,

For the DoubleMA issue, DoubleMA has the following code:

if (Signal[0] == 1)
dmv.Set(RisingPlot[0]);
if (Signal[0] == -1)
dmv.Set(FallingPlot[0]);
if (Signal[0] == 0)
dmv.Set(NeutralPlot[0]);

Create 3 user defined inputs in the strategy, call them Rising, Falling, and Neutral. Give them the the 1, 0, -1 values.

Now you are using apples and apples!!!

With DoubleMA plot option on the left side set to signal, use == to user defined variables Rising, Falling, and Neutral on the right side.

Left and right sides will now agree and compile.

I hope this helps,

RJay

Reply With Quote
 
(login for full post details)
  #3 (permalink)
New York, NY
 
 
Posts: 142 since Dec 2009
Thanks: 41 given, 87 received


RJay,

Thanks for responding. Pretend, though, that I am a complete idiot when it comes to NinjaScript (pretend = I really am)

I followed your instuctions as follows:

Name = Rising, Type = int, Default = 1, Min = 1, Description = Rising DoubleMA (added your conditions for falling and neutral as well). After that, I added DoubleMA to the left (5 HMA, 45 VMA, signal), == in the middle and "rising" to the left. Got the same 'Boolean' error message.

Did I miss something?

Thanks

Reply With Quote
 
(login for full post details)
  #4 (permalink)
Hartford, CT. USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AMP/CQG, Kinetick
Trading: RTY
 
RJay's Avatar
 
Posts: 688 since Jun 2009
Thanks: 747 given, 780 received


dsraider View Post
RJay,

Thanks for responding. Pretend, though, that I am a complete idiot when it comes to NinjaScript (pretend = I really am)

I followed your instuctions as follows:

Name = Rising, Type = int, Default = 1, Min = 1, Description = Rising DoubleMA (added your conditions for falling and neutral as well). After that, I added DoubleMA to the left (5 HMA, 45 VMA, signal), == in the middle and "rising" to the left. Got the same 'Boolean' error message.

Did I miss something?

Thanks

dsraider,

Your getting there. each indicator requires an "if" condition. First line built in the prior post determines the direction of the DoubleMA indicator.

HMA and VMA have decimal style outputs. rising and falling can be determined by looking at the prior bar.

Set conditions:

if HMA[1] > HMA[0] (This means if its falling condition)

if HMA[1] < HMA[0] (This means if its rising condition)

The same is true for VMA.


You set one condition for each indicator for a total of three for each "set".

When all three are true, program will execute the "Do the following command" for that set.

RJay

Reply With Quote
The following user says Thank You to RJay for this post:
 
(login for full post details)
  #5 (permalink)
New York, NY
 
 
Posts: 142 since Dec 2009
Thanks: 41 given, 87 received

I wish I could say that helped but I felt smarter before this post I assume this means I will need to code directly and can't use the wizard for all of this?

By the way, I used to live in Hartford. You're not a fellow UHA grad, are you? If so, well then, I'm sorry...

Reply With Quote
 
(login for full post details)
  #6 (permalink)
New York, NY
 
 
Posts: 142 since Dec 2009
Thanks: 41 given, 87 received

If anyone here has used TSsupertrend in a strategy, could you please, for the love of everything holy, PM me or post an existing cs file to this thread? I would greatly appreciate it, as would the last remaining hairs in my head.

Thanks in advance,
Dave

Reply With Quote


futures io Trading Community Platforms and Indicators NinjaTrader > DoubleMA strategy error


Last Updated on January 25, 2010


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

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

March
 

Importance of Finding Your Own Way w/Adam Grimes

Elite only
 

Journal Challenge w/Jigsaw

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