DoubleMA strategy error - NinjaTrader Programming | futures io social day trading
futures io futures trading


DoubleMA strategy error
Updated: Views / Replies:1,735 / 5
Created: by dsraider Attachments:0

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
 
Thread Tools Search this Thread
 

DoubleMA strategy error

  #1 (permalink)
Trading for Fun
New York, NY
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: Amp Futures/Zen-Fire
Favorite Futures: ES
 
Posts: 142 since Dec 2009
Thanks: 41 given, 83 received

DoubleMA strategy error

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
 
  #2 (permalink)
 Vendor: www.innovative-trading-solutions-online.com 
Hartford, CT. USA
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: AMP/CQG, Kinetick
Favorite Futures: TF
 
RJay's Avatar
 
Posts: 677 since Jun 2009
Thanks: 726 given, 740 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
 
  #3 (permalink)
Trading for Fun
New York, NY
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: Amp Futures/Zen-Fire
Favorite Futures: ES
 
Posts: 142 since Dec 2009
Thanks: 41 given, 83 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
 
  #4 (permalink)
 Vendor: www.innovative-trading-solutions-online.com 
Hartford, CT. USA
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: AMP/CQG, Kinetick
Favorite Futures: TF
 
RJay's Avatar
 
Posts: 677 since Jun 2009
Thanks: 726 given, 740 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:
 
  #5 (permalink)
Trading for Fun
New York, NY
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: Amp Futures/Zen-Fire
Favorite Futures: ES
 
Posts: 142 since Dec 2009
Thanks: 41 given, 83 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
 
  #6 (permalink)
Trading for Fun
New York, NY
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: Amp Futures/Zen-Fire
Favorite Futures: ES
 
Posts: 142 since Dec 2009
Thanks: 41 given, 83 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

Reply



futures io > > > > > DoubleMA strategy error

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
TSSuperTrend Strategy error Azzzz NinjaTrader Programming 32 October 7th, 2011 08:38 AM
My First MTF Strategy .. need some minor error fixes Trader.Jon The Elite Circle 4 May 14th, 2010 09:58 PM
Strategy Analyzer Error jeffbg123 NinjaTrader Programming 3 April 8th, 2010 09:17 PM
Logic Error in Strategy HJay NinjaTrader Programming 14 November 1st, 2009 07:05 PM
DoubleMA Maletor NinjaTrader Programming 2 June 12th, 2009 07:58 PM


All times are GMT -4. The time now is 09:10 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-11 in 0.11 seconds with 19 queries on phoenix via your IP 54.83.122.227