NexusFi: Find Your Edge


Home Menu

 





What does "Value" represents?


Discussion in NinjaTrader

Updated
    1. trending_up 3,765 views
    2. thumb_up 2 thanks given
    3. group 1 followers
    1. forum 2 posts
    2. attach_file 0 attachments




 
Search this Thread

What does "Value" represents?

  #1 (permalink)
 wolfcuring 
ChangChun+China
 
Experience: Intermediate
Platform: Ninja Trader 8
Trading: Futures
Posts: 4 since Oct 2011
Thanks Given: 1
Thanks Received: 0

Hi all,

Sorry for the simplicity of my question. I am learning to code, and stuck with the first example I am reading: SMA.

protected override void OnBarUpdate()
{
if (CurrentBar == 0)
Value.Set(Input[0]);
else
{
double last = Value[1] * Math.Min(CurrentBar, Period);

if (CurrentBar >= Period)
Value.Set((last + Input[0] - Input[Period]) / Math.Min(CurrentBar, Period));
else
Value.Set((last + Input[0]) / (Math.Min(CurrentBar, Period) + 1));
}
}

It seems that Value[1] here should represent the median one bar ago, is this correct?

I tested the the "Value[0]" on a chart, but it shows that it is equal to Close[0].

Quite confused with how NinjaScript would process price data .

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Are there any eval firms that allow you to sink to your …
Traders Hideout
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Exit Strategy
NinjaTrader
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
65 thanks
Funded Trader platforms
41 thanks
Battlestations: Show us your trading desks!
29 thanks
NexusFi site changelog and issues/problem reporting
23 thanks
The Program
19 thanks

  #3 (permalink)
 
NinjaTrader's Avatar
 NinjaTrader  NinjaTrader is an official Site Sponsor
Site Sponsor

Web: NinjaTrader
AMA: Ask Me Anything
Webinars: NinjaTrader Webinars
Elite offer: Click here
 
Posts: 1,713 since May 2010
Thanks Given: 203
Thanks Received: 2,686


Value represents the numeric value of the primary (1st plot) of the indicator. By default, this is initialized to the close price of the underlying data series if your indicator does not set the value to something else.

Follow me on Twitter Reply With Quote
Thanked by:





Last Updated on December 20, 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