NexusFi: Find Your Edge


Home Menu

 





Use of Rising() and Slope()


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one MXASJ with 12 posts (0 thanks)
    2. looks_two Prtester with 3 posts (0 thanks)
    3. looks_3 zeller4 with 1 posts (0 thanks)
    4. looks_4 tortexal with 1 posts (0 thanks)
    1. trending_up 10,292 views
    2. thumb_up 0 thanks given
    3. group 4 followers
    1. forum 17 posts
    2. attach_file 2 attachments




 
Search this Thread

Use of Rising() and Slope()

  #11 (permalink)
 MXASJ 
Asia
 
Experience: Beginner
Platform: NinjaTrader, TOS
Posts: 796 since Jun 2009
Thanks Given: 109
Thanks Received: 800

Thanks Prtester. The TSSupertrend Trend=True looks strange, so let's see how it works out! Compiled and running live sim on ES and FESX;

///GO LONG: Conditions followed by ATM Strategy execution.
if (TSSuperTrend(14, TradingStudies.NinjaScript.Utility.MovingAverageType.SMA, 2.618, 14, TradingStudies.NinjaScript.Utility.SuperTrendMode.ATR).Trend[0] == true
&& ATRratio(49, 7, 1).Ratio[0] >= 1
&& (ADXVMA_sharky_paint(9, true).Main[0] > ADXVMA_sharky_paint(9, true).Main[1])
&& (ADXVMA_sharky_paint(9, true).Main[0] > ADXVMA_sharky_paint(9, true).Main[2])
&& (ECO2New2(7, 4, 21).Main[0] > ECO2New2(7, 4, 21).Signal[0])
&& Rising(ECO2New2(7, 4, 21).Main) == true)

//ATM strategy code here


///GO SHORT: Conditions followed by ATM Strategy execution.
if (TSSuperTrend(14, TradingStudies.NinjaScript.Utility.MovingAverageType.SMA, 2.618, 14, TradingStudies.NinjaScript.Utility.SuperTrendMode.ATR).Trend[0] == false
&& ATRratio(49, 7, 1).Ratio[0] >= 1
&& (ADXVMA_sharky_paint(9, true).Main[0] < ADXVMA_sharky_paint(9, true).Main[1])
&& (ADXVMA_sharky_paint(9, true).Main[0] < ADXVMA_sharky_paint(9, true).Main[2])
&& (ECO2New2(7, 4, 21).Main[0] < ECO2New2(7, 4, 21).Signal[0])
&& Falling(ECO2New2(7, 4, 21).Main) == true)

//ATM strategy code here

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Quantum physics & Trading dynamics
The Elite Circle
REcommedations for programming help
Sierra Chart
MC PL editor upgrade
MultiCharts
ZombieSqueeze
Platforms and Indicators
 
  #12 (permalink)
 MXASJ 
Asia
 
Experience: Beginner
Platform: NinjaTrader, TOS
Posts: 796 since Jun 2009
Thanks Given: 109
Thanks Received: 800

FYI I ran that on the ES and FESX and it appears to enter and exit trades as it should, so thanks all! As-is it was not a profitable strategy in yesterdays markets when combined with my ATM strategy, but at least I've got some working code to build upon and test.

Started this thread Reply With Quote
  #13 (permalink)
 MXASJ 
Asia
 
Experience: Beginner
Platform: NinjaTrader, TOS
Posts: 796 since Jun 2009
Thanks Given: 109
Thanks Received: 800


Just got a wrong trade. The system went short on the ES at 10:40 when;

ADXVMA (Panel 1) says short OK
ATR Ratio (Panel 2) says OK to trade
ECO2New2 (Panel 3) says short OK

But... the green line (in Panel 1) at price 875.44 is TSSupertrend saying don't short... so something isn't right yet. Any ideas?

Thanks

Attached Thumbnails
Click image for larger version

Name:	wrongtradettst.jpg
Views:	234
Size:	153.3 KB
ID:	638  
Started this thread Reply With Quote
  #14 (permalink)
 MXASJ 
Asia
 
Experience: Beginner
Platform: NinjaTrader, TOS
Posts: 796 since Jun 2009
Thanks Given: 109
Thanks Received: 800

... and it just went short again when the green line @ 875.44 should not allow that. Hmmm.

Attached Thumbnails
Click image for larger version

Name:	SP32-20090709-232123.jpg
Views:	206
Size:	172.1 KB
ID:	639  
Started this thread Reply With Quote
  #15 (permalink)
tortexal
Panama!
 
Posts: 44 since Jun 2009
Thanks Given: 1
Thanks Received: 24

idk if you have resolved this issue yet however from my experiences, ninja cannot consistently obtain accurate values from and indicators of an indicator with out it being calculated all within one app locally. This may be why you are getting weird results w/ rise and slope or w/e

the most reliable way i have found to get around this is to calculate the net change in the strat or indicator locally by finding the different from [0] to [1] which will usually yield some decimal. I multiple that by 10, 100 or 1000 to bring it back to "normal" values. The result is binary in the sense positive is uptrend, neg is downtrend. Velocity is also measured by the range of 0 to -(X) and 0 to (X). That way you can base the strat/indicator off of meeting a min threshold of velocity before taking action to avoid noise or "sideways" situations.

i built a separate indicator that always does this, however trying to reference its output from another strat or indicator will only "sometimes" yield correct data yet the calculations are correct on both ends. However if everything is coded locally 1 strat the output is always correct.

Reply With Quote
  #16 (permalink)
 MXASJ 
Asia
 
Experience: Beginner
Platform: NinjaTrader, TOS
Posts: 796 since Jun 2009
Thanks Given: 109
Thanks Received: 800

Thanks tortexal I look at that. It all seems to come back to how the strat is looking at TSSupertrend. I'll take a deeper look at that indicators code. Still a bit fuzzy as I just woke up but I'm thinking "close above whatever that line vaue is=long ok, clode below whatever that line vaue is=short ok" is worth a shot.

The other three indicators seem to be working in concert ok, but as a system its missing trades it should enter and entering trades it shouldn't with a higher frequency than I like.

Started this thread Reply With Quote
  #17 (permalink)
 MXASJ 
Asia
 
Experience: Beginner
Platform: NinjaTrader, TOS
Posts: 796 since Jun 2009
Thanks Given: 109
Thanks Received: 800

This compiled and will be tested on market replay data for the next few hours;

if (Close[0] > TSSuperTrend(14, TradingStudies.NinjaScript.Utility.MovingAverageType.SMA, 2.618, 14, TradingStudies.NinjaScript.Utility.SuperTrendMode.ATR).DownTrend[1]

Lets see what happens!

Started this thread Reply With Quote
  #18 (permalink)
 krakken 
atlanta
 
Experience: Beginner
Platform: NinjaTrader, MetaTrader
Trading: CL
Posts: 8 since Jun 2011
Thanks Given: 2
Thanks Received: 3

MXASJ...how did your test work out?

Reply With Quote




Last Updated on August 13, 2011


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts