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 Quick Summary with 1 posts (0 thanks)
    3. looks_3 gulabv with 1 posts (0 thanks)
    4. looks_4 Fat Tails with 1 posts (0 thanks)
    1. trending_up 2,430 views
    2. thumb_up 0 thanks given
    3. group 4 followers
    1. forum 6 posts
    2. attach_file 0 attachments




 
Search this Thread

NT Falling() Syntax

  #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,621 since Aug 2010
Thanks Given: 1,071
Thanks Received: 5,994

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?
What broker to use for trading palladium futures
Commodities
Trade idea based off three indicators.
Traders Hideout
ZombieSqueeze
Platforms and Indicators
How to apply profiles
Traders Hideout
Cheap historycal L1 data for stocks
Stocks and ETFs
 
  #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,621 since Aug 2010
Thanks Given: 1,071
Thanks Received: 5,994

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, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,103


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,621 since Aug 2010
Thanks Given: 1,071
Thanks Received: 5,994

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


© 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