NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Sunday May 26th at 12PM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > Application Technical Support > Strategy Analyzer

Strategy Analyzer Support for automated system backtesting and optimization using the NinjaTrader Strategy Analyzer.

Reply
 
Thread Tools Display Modes
Old 08-02-2012, 11:08 PM   #1
dukeb
Senior Member
 
Join Date: Mar 2012
Posts: 102
Thanks: 29
Thanked 4 times in 4 posts
Default New to NT. Simple Strategy Does Not Work

Am new to NT. I am trying a simple strategy (see attachment) to begin learning.
As you can see I want to get a 'beep' when the #1 bar > #2 bar on a 50 period SMA. There are no trades to be made only a 'beep'. I cannot get any 'beeps' from strategy backtest nor do I get anything from the charts. When I first did this, I chose to have an email sent. I changed it to a 'beep' for testing.

What am I doing wrong?

Thank you,
Duke
Attached Images
File Type: png strategy.png (7.8 KB, 7 views)
dukeb is offline  
Reply With Quote
Old 08-02-2012, 11:13 PM   #2
NinjaTrader_Matthew
NinjaTrader Customer Service
 
NinjaTrader_Matthew's Avatar
 
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,794
Thanks: 160
Thanked 568 times in 559 posts
Default

Duke,

Audio alerts will only be processed in real-time, so you will not hear anything when backtesting.

You will only hear this alert on the chart when it is enabled and at the moment that condition is true.

I'd suggest using the Print function under 'Do the following' to print a statement to the Tools--> Output window.

Then run your backtest and check this output window to ensure this condition has ever returned as true.
NinjaTrader_Matthew is offline  
Reply With Quote
Old 08-03-2012, 12:23 AM   #3
dukeb
Senior Member
 
Join Date: Mar 2012
Posts: 102
Thanks: 29
Thanked 4 times in 4 posts
Default Thank you Matthew

Quote:
Originally Posted by NinjaTrader_Matthew View Post
Duke,

Audio alerts will only be processed in real-time, so you will not hear anything when backtesting.

You will only hear this alert on the chart when it is enabled and at the moment that condition is true.

I'd suggest using the Print function under 'Do the following' to print a statement to the Tools--> Output window.

Then run your backtest and check this output window to ensure this condition has ever returned as true.
Thank you Matthew...
dukeb is offline  
Reply With Quote
Old 08-03-2012, 12:28 AM   #4
dukeb
Senior Member
 
Join Date: Mar 2012
Posts: 102
Thanks: 29
Thanked 4 times in 4 posts
Default Matthew

Quote:
Originally Posted by dukeb View Post
Thank you Matthew...
I altered the strategy to print to the output window. Nothing happened when I ran backtest. Perhaps you could give it a try. As you can see it is very simple.
I must be missing something here.
Than you for your help.
Duke
dukeb is offline  
Reply With Quote
Old 08-03-2012, 02:15 AM   #5
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
Default

Please give this a try Duke, prints a visual drawing on the chart once your condition triggers. What did you backtest on btw? Do you have the data / resolution for it available through your provider?

All the best,
Attached Files
File Type: zip Duke.zip (3.6 KB, 5 views)
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 08-03-2012, 08:00 AM   #6
dukeb
Senior Member
 
Join Date: Mar 2012
Posts: 102
Thanks: 29
Thanked 4 times in 4 posts
Smile A big thanks...

Quote:
Originally Posted by NinjaTrader_Bertrand View Post
Please give this a try Duke, prints a visual drawing on the chart once your condition triggers. What did you backtest on btw? Do you have the data / resolution for it available through your provider?

All the best,
It works great. I have a question.
New code "DrawDiamond("My diamond" + CurrentBar, false, 0, Low[0] + -2 * TickSize, Color.Red);"
"My diamond" is a tag. How does one use this for other scripts?
I backtested on the AUD/USD. I don't understand what you mean when you reference "data/resolution". I am not live. I use MB Trading datafeed.
I looked up the parameters for DrawDiamond. The "y" value has been omitted. In your script and the example in the reference manual. The reference example uses 'True'. Exactly, what is the 'y' value for?

I want to thank you again for your help.

Duke


dukeb is offline  
Reply With Quote
Old 08-03-2012, 09:11 AM   #7
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
Default

You are welcome - glad to hear this worked out for you.

The tag is just internal to the script, to prevent malicious code from another interfering there's no external access to those.

With resolution, I just meant which chart type and timeframe, so for example some connections dont have daily data access and customers dont realize it until they getting empty results in the backtest window for non availability of data.

Y is just the Y Axis double value the object would be placed, so the price - the 'true' from the sample was probably the autoScale parameter.

http://www.ninjatrader.com/support/h...rawdiamond.htm
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 08-03-2012, 12:03 PM   #8
dukeb
Senior Member
 
Join Date: Mar 2012
Posts: 102
Thanks: 29
Thanked 4 times in 4 posts
Default Thank you Bertrand .... on another issue

The diamond prints(yhanks to you). However the email does not work.
My intent was to have an email sent when the SMA condition was met.
I still get the diamond, but no email.

if (SMA(50)[0] > SMA(50)[1])
{
DrawDiamond(
"My diamond" + CurrentBar, false, 0, Low[0] + -2 * TickSize, Color.Blue);
SendMail(
"", "dbushong@schurusa.com", "test alert", "success");

Can you bail me out again?
Duke
dukeb is offline  
Reply With Quote
Old 08-04-2012, 08:43 AM   #9
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
Default

Duke, if you go under Tools > Options > Misc and test your email setup - does this work out?
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 08-04-2012, 09:07 AM   #10
dukeb
Senior Member
 
Join Date: Mar 2012
Posts: 102
Thanks: 29
Thanked 4 times in 4 posts
Default

Thank you, Bertrand. Yes, I now receive emails.
Thanks to your support, I am moving forward nicely.
Best regards,
Duke
dukeb is offline  
Reply With Quote
Old 08-04-2012, 09:41 AM   #11
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
Default

Glad to hear, enjoy your weekend Duke.
NinjaTrader_Bertrand is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple SL, TP, Breakeven don't work kucharek Strategy Development 8 11-23-2011 06:39 AM
How come a simple volume[0] > 20000 doesnt work? nasdaq5048 Indicator Development 13 11-24-2010 09:23 AM
Script in NT 6.5 does not work in NT 7 atrader Strategy Development 3 04-15-2010 10:27 AM
Simple question about a simple strategy. shakira Strategy Development 1 02-14-2009 10:56 AM
A simple question from a new NT programmer elemento-portador Indicator Development 1 11-05-2007 08:00 AM


All times are GMT -6. The time now is 12:00 AM.