NexusFi: Find Your Edge


Home Menu

 





NT Falling() Syntax


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one aligator with 3 posts (0 thanks)
    2. looks_two Fat Tails with 1 posts (0 thanks)
    3. looks_3 sunpost with 1 posts (0 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 3,057 views
    2. thumb_up 0 thanks given
    3. group 4 followers
    1. forum 6 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 
aligator's Avatar
 aligator 
Las Vegas, NV
Market Wizard
 
Experience: Advanced
Platform: Abacus, Slide Rule, HP-65
Trading: Futures, Stocks, Options
Posts: 3,778 since Aug 2010
Thanks Given: 1,104
Thanks Received: 6,182

The following NT condition

if (Falling(SMA(20)))

Checks for a falling condition which is true when the current value is less than the value of 1 bar ago. How do you write the script to check if the value of 1 bar ago is less than the value of 2 bars ago, and so on?

Thanks.


Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Netherlands & Germany Surge as World Cup Field Narro …
Prediction Markets & Event Contracts
CME Launches Bitcoin Volatility Futures June 1 -- First …
Cryptocurrency
The June 15 Resolution Trap: Irans Agreed Text Still Pri …
Prediction Markets & Event Contracts
Rubios Good News Within Hours and the 30-Day Math: Why H …
Prediction Markets & Event Contracts
S&P 500 Holds the Line: No Fast Track for SpaceX, Op …
Stocks and ETFs
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
8 thanks
Darmok and Jalad at Tanagra
1 thanks
  #3 (permalink)
 
sunpost's Avatar
 sunpost 
Pennsylvania, USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: IB/Kinetick
Trading: Forex
Posts: 60 since Aug 2010
Thanks Given: 202
Thanks Received: 42


You can try LowestBar ...

 
Code
 if (LowestBar(SMA(20), barsago) == 0)


Reply With Quote
  #4 (permalink)
 
aligator's Avatar
 aligator 
Las Vegas, NV
Market Wizard
 
Experience: Advanced
Platform: Abacus, Slide Rule, HP-65
Trading: Futures, Stocks, Options
Posts: 3,778 since Aug 2010
Thanks Given: 1,104
Thanks Received: 6,182

Thanks sunpost. But this really does not do what I want. Maybe if I give an example would help:

Example: If SMA of one bar (or any bar) ago is less than SMA of two bar (or any bar) ago, then...

I want to know if I can do this using the Falling() syntax.


Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #5 (permalink)
 
gulabv's Avatar
 gulabv 
Dallas, TX
 
Experience: Beginner
Platform: Ninjatrader
Broker: Zen-Fire
Trading: ZN, 6E
Posts: 286 since May 2010
Thanks Given: 161
Thanks Received: 169

Falling() does not support barsago as a parameter it is always checking between the current bar and 1 bar ago.

Why don't you just compare the SMA values directly?

Instrument.MasterInstrument.Compare(SMA(x), SMA(y)) == -1

substitute x and y for the number of bars ago you want to check the SMA value for


Reply With Quote
  #6 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Interactive Brokers
Trading: Futures & Stocks
Posts: 9,887 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,117


aligator View Post
The following NT condition

if (Falling(SMA(20)))

Checks for a falling condition which is true when the current value is less than the value of 1 bar ago. How do you write the script to check if the value of 1 bar ago is less than the value of 2 bars ago, and so on?

Thanks.

falling condition one bar ago:

 
Code
if (SMA(20)[1] < SMA(20)[2])
As far as I know, the Falling() method is limited to the current bar.


Reply With Quote
  #7 (permalink)
 
aligator's Avatar
 aligator 
Las Vegas, NV
Market Wizard
 
Experience: Advanced
Platform: Abacus, Slide Rule, HP-65
Trading: Futures, Stocks, Options
Posts: 3,778 since Aug 2010
Thanks Given: 1,104
Thanks Received: 6,182

Thank you everyone, Fat Tails, Gulabv, and Sunpost.


Visit my NexusFi Trade Journal Started this thread Reply With Quote




Last Updated on March 10, 2011


© 2026 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 - Downloads - Top
no new posts