NexusFi: Find Your Edge


Home Menu

 





How to have value show in data series?


Discussion in NinjaTrader

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




 
Search this Thread
  #1 (permalink)
 stearno 
Muscat, Oman
 
Experience: Intermediate
Platform: Ninja and MT4
Trading: Forex
Posts: 15 since Apr 2012
Thanks Given: 4
Thanks Received: 3

I am new to NT7 code. I have this indicator that shows divergence based upon Momentum and draws lines on chart. But I want it to show a value in the data series, so I can have it do alerts in Market Analyzer and maybe someday in Strategies. How can I assign a value to kdbuy and kdsell in the attached. I tried to do it after looking at other strategies, but it did not work. I appreciate the advice.


Attached Files
Elite Membership required to download: MomDivergence.cs
Elite Membership required to download: MomMomentum.cs
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Post-Summit Market Verdict: ES -1%, NQ -1.5%, 10-Year Yi …
Traders Hideout
Kalshi Rockets to $22B, Passes Polymarket in Volume -- B …
Prediction Markets & Event Contracts
Topstep Acquires The Futures Desk -- Prop Firm Consolida …
Funded Trading Evaluation Firms
Asia Equities Crash Overnight -- Nikkei -5.2%, KOSPI -6. …
Traders Hideout
Oil Surges ~18% in One Week as Iran Conflict Disrupts Gl …
Commodities
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
24 thanks
2026 Jlab journal
10 thanks
Trying to learn Volume and price action correlation
8 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Lady Vols Primer: Trading Volatility Journal
6 thanks
  #3 (permalink)
 stearno 
Muscat, Oman
 
Experience: Intermediate
Platform: Ninja and MT4
Trading: Forex
Posts: 15 since Apr 2012
Thanks Given: 4
Thanks Received: 3


Okay, I figured it out. I had said DataSeries, but I meant Data Box. Once I figured out I was calling it the wrong thing, and searched for the correct term, then I found more resources.

I was assigning variables to both public and private classes, which was a mistake. I now fixed it:

I removed all the assignments at the top in the variables region and in the OnIntialize region.

I kept at the bottom Properties region where I declared the public classes for the variables and assigned them to the Values[1] and Values[2]. Then, when I wanted to assign the price to this variable in the actual code, I used "Values[1].Set(Close(0))" and "Values[2].Set(Close(0))". Very simple coding after I figured it out.

-Stearno


Attached Files
Elite Membership required to download: MomDivergence.cs
Started this thread Reply With Quote




Last Updated on October 29, 2014


© 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