NexusFi: Find Your Edge


Home Menu

 





What does "Value" represents?


Discussion in NinjaTrader

Updated
    1. trending_up 3,783 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?
ZombieSqueeze
Platforms and Indicators
MC PL editor upgrade
MultiCharts
Cheap historycal L1 data for stocks
Stocks and ETFs
Quantum physics & Trading dynamics
The Elite Circle
REcommedations for programming help
Sierra Chart
 
  #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,714 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