What does VarName.Set(1, VarName[1]) do? - futures io
futures io



What does VarName.Set(1, VarName[1]) do?


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one jvbehar with 4 posts (0 thanks)
    2. looks_two Big Mike with 1 posts (0 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 eDanny with 1 posts (0 thanks)
    1. trending_up 1,215 views
    2. thumb_up 0 thanks given
    3. group 3 followers
    1. forum 7 posts
    2. attach_file 2 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

What does VarName.Set(1, VarName[1]) do?

(login for full post details)
  #1 (permalink)
jvbehar
Miami, Florida USA
 
 
Posts: 5 since Dec 2010
Thanks: 0 given, 0 received

Hello All: What does this statement do?

VarName.Set(1, VarName[1])

Is the "1" an initialization value of some sort?

Thank you for any guidance you can provide.

Reply With Quote

Can you help answer these questions
from other members on futures io?
Eurex Denali vs dxFeed
Sierra Chart
TradingView help in improving Anchored Vwap
Platforms and Indicators
TD Sequential for NT or MW?
Platforms and Indicators
1 min chart v-shape scan help please
ThinkOrSwim
Is there inherently more opportunity in smaller markets?
Traders Hideout
 
 
(login for full post details)
  #3 (permalink)
 Xeno 
UK
 
Experience: Intermediate
Platform: Ninja
Broker: Mirus/Zen
Trading: Futures - bonds, currencies, index
 
Posts: 288 since Oct 2010
Thanks: 70 given, 270 received


The "1" is an index into an array called VarName.

VarName[1] means the element in the array which has index 1.

Reply With Quote
 
(login for full post details)
  #4 (permalink)
jvbehar
Miami, Florida USA
 
 
Posts: 5 since Dec 2010
Thanks: 0 given, 0 received

Xeno, thank you for your reply. This is from the attached Ninja script for the SuperTrend Indicator. I was refering to the first "1", in the line

VarName.Set(1, VarName[1]) (the [1] reference here is to "the value at prior bar")

There are no arrays defined as far as I can see. There are references of similar structure with a single dimension such as

VarName.Set(VarName[1]);

so to see the two arguments is throwing me off.

I am experienced in EL and am trying to convert from the NT script.

Thank you for again for your attention.

Attached Files
Register to download File Type: txt Supertrend Code.txt (9.4 KB, 8 views)
Reply With Quote
 
(login for full post details)
  #5 (permalink)
 eDanny 
East Rochester, NY
 
Experience: Intermediate
Platform: NT
 
eDanny's Avatar
 
Posts: 329 since Jul 2009
Thanks: 17 given, 423 received

This is referencing a plot. The first 1 means plot one bar back and the [1] means use the value from one bar back in that plot. This is usually used to join two different line plots together when the color changes else you might get a one bar blank spot.

Dan

Reply With Quote
 
(login for full post details)
  #6 (permalink)
jvbehar
Miami, Florida USA
 
 
Posts: 5 since Dec 2010
Thanks: 0 given, 0 received

Danny, got it, thank you very much!

Reply With Quote
 
(login for full post details)
  #7 (permalink)
 Big Mike 
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: Custom solution
Trading: Futures & Crypto
 
Big Mike's Avatar
 
Posts: 50,129 since Jun 2009
Thanks: 32,601 given, 98,784 received


jvbehar View Post
Xeno, thank you for your reply. This is from the attached Ninja script for the SuperTrend Indicator.

If your intention is to convert SuperTrend to EL, check here:


Mike

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/

Visit other sites? Please spread the word about your experience with our community!
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #8 (permalink)
jvbehar
Miami, Florida USA
 
 
Posts: 5 since Dec 2010
Thanks: 0 given, 0 received

Mike, thanks for tip. That is actually where I started. I ran your code but the display was nothing like the NT indicator that supposedly does the same thing. I could not really tell why, hence I needed to convert line-by-line directly from the NT script to see where the discrepancy was. I believe the code difference is minor but the resulting display differences are not.

If you are familiar with Ninja script I would appreciate if you take a quick look at the attached, maybe something will jump out at you.

Thank you in advance.

JBehar

Attached Files
Register to download File Type: txt Supertrend Code.txt (9.4 KB, 7 views)
Reply With Quote


futures io Trading Community Platforms and Indicators NinjaTrader > What does VarName.Set(1, VarName[1]) do?


Last Updated on December 5, 2010


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Our 12-year anniversary w/ $$,$$$ prizes (check soon)

August
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada), info@futures.io
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.
no new posts