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 2,921 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
Legendary Market Wizard
 
Experience: Advanced
Platform: Abacus, Slide Rule, HP-65
Trading: Futures, Stocks, Options
Posts: 3,777 since Aug 2010
Thanks Given: 1,103
Thanks Received: 6,181

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?
SEC Chairman Calls for New Golden Age of SEC-CFTC Regula …
Traders Hideout
The May 31 Binary: 60% Trump Declares Iran Ops Over, Onl …
Prediction Markets & Event Contracts
GDP Day: The First Economic Reckoning -- Pahlavi at 6.55 …
Prediction Markets & Event Contracts
CME Raises Energy Futures Margins After Iran-War Volatil …
Commodities
CME Group Fee Schedule Changes Hit All Four Exchanges -- …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
24 thanks
2026 Jlab journal
10 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Lady Vols Primer: Trading Volatility Journal
6 thanks
Trying to learn Volume and price action correlation
5 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
Legendary Market Wizard
 
Experience: Advanced
Platform: Abacus, Slide Rule, HP-65
Trading: Futures, Stocks, Options
Posts: 3,777 since Aug 2010
Thanks Given: 1,103
Thanks Received: 6,181

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
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,114


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
Legendary Market Wizard
 
Experience: Advanced
Platform: Abacus, Slide Rule, HP-65
Trading: Futures, Stocks, Options
Posts: 3,777 since Aug 2010
Thanks Given: 1,103
Thanks Received: 6,181

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