NinjaTrader Support Forum  
X

Attention!

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


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Indicator Development

Indicator Development Support for the development of custom indicators using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 04-08-2009, 11:36 AM   #1
faithpips
Junior Member
 
Join Date: Mar 2009
Posts: 3
Thanks: 0
Thanked 0 times in 0 posts
Unhappy SMA crossover using NT script

I am having problem with Sma crossing. I use sma 20 and sma 4 and to get an alert when 4 crosses over 20 to show a green triangle and when 4 crosses below 20 for red triangle. I see it visually on the chart, but the triangles show up after the fact on all 4x instruments and when it sends email to me I don't which instrument was triggered.do I have to have nt script on each instrument for email to be specific. I have example of one of the charts attached.wrong sma crossovers on 4x instrument using NT strategy.JPG Can some help??? I have tried it several times and the signal occurs but the triangles show several pips later. thanks in advance
faithpips is offline  
Reply With Quote
Old 04-08-2009, 11:39 AM   #2
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

faithpips,

Crosses can occur any time, but you can only place objects or anything like that on actual bars. The arrow pointing to it is the correct place for the cross.
NinjaTrader_Josh is offline  
Reply With Quote
Old 04-09-2009, 08:43 PM   #3
faithpips
Junior Member
 
Join Date: Mar 2009
Posts: 3
Thanks: 0
Thanked 0 times in 0 posts
Default

Josh I am not sure I understand what ur saying but if u look at the chart posted the crossover is highlighted in yellow using NT sript, the triangles are showing after the cross and I just want to know how to fix it. thanks
faithpips is offline  
Reply With Quote
Old 04-09-2009, 11:19 PM   #4
decus
Junior Member
 
Join Date: Feb 2008
Posts: 9
Thanks: 0
Thanked 0 times in 0 posts
Default

The triangles are showing in the correct locations - the bar after the cross occurs. From your screenshot, most of the crosses occur between bars.

Have a read of the help file about onbarupdate and calculateonbarclose: http://www.ninjatrader-support.com/H...dateEvent.html
decus is offline  
Reply With Quote
Old 04-25-2009, 01:36 PM   #5
faithpips
Junior Member
 
Join Date: Mar 2009
Posts: 3
Thanks: 0
Thanked 0 times in 0 posts
Default

Thanks decus, I have been away for a while. What I am trying to achieve is to get the cross over as it happens not after the fact. Waiting til the bar closes is too late.
faithpips is offline  
Reply With Quote
Old 05-01-2009, 03:46 PM   #6
lakayana
Junior Member
 
Join Date: Apr 2009
Posts: 1
Thanks: 0
Thanked 0 times in 0 posts
Default Help!!!! Sma Crossovers

How can I write this program on my strategy.
I want an indicator on my chart when the opening bar is above both the 8 and the 20 SMA and vis versa.
THANKS
LAKAYANA
lakayana is offline  
Reply With Quote
Old 05-01-2009, 03:53 PM   #7
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

lakayana,

I suggest you review the tutorial on how to make strategies with the Strategy Wizard here first: http://www.ninjatrader-support.com/H...tml?Overview34

You want to just create yourself a Price vs Indicator condition. Please see this article for an idea: http://www.ninjatrader-support.com/H...ataComparisons
Instead of doing price vs price, on one side just select an indicator instead.
NinjaTrader_Josh 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
Draw a x minute SMA/SMA/WMA on another timeframe? ninjamouse Indicator Development 4 04-06-2009 06:54 AM
Lower High script for NT rehtrade Automated Trading 12 03-30-2009 11:21 AM
Once per crossover? 5iver Strategy Development 6 12-13-2008 12:37 PM
where is the latest and correct sampel script for using eSignal EFS + NT DLL clearpicks Automated Trading 1 05-22-2008 10:49 PM
How can I run a NT Script on 20 different Forex Symbols without 20 charts open? ccie8340 Automated Trading 3 07-29-2007 11:24 PM


All times are GMT -6. The time now is 10:54 PM.