NexusFi: Find Your Edge


Home Menu

 





Stochastics coding help needed!


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Saroj with 10 posts (1 thanks)
    2. looks_two RodS with 8 posts (0 thanks)
    3. looks_3 zt379 with 5 posts (0 thanks)
    4. looks_4 roonius with 4 posts (7 thanks)
      Best Posters
    1. looks_one Alan with 2 thanks per post
    2. looks_two roonius with 1.8 thanks per post
    3. looks_3 wh with 1 thanks per post
    4. looks_4 Saroj with 0.1 thanks per post
    1. trending_up 14,282 views
    2. thumb_up 12 thanks given
    3. group 4 followers
    1. forum 33 posts
    2. attach_file 10 attachments




 
Search this Thread

Stochastics coding help needed!

  #31 (permalink)
 zeller4 
Orlando Florida
 
Experience: Intermediate
Platform: NT8
Trading: CL, NQ, ES, RTY
Posts: 477 since Jun 2009
Thanks Given: 1,416
Thanks Received: 404

Roonius,

thanks for coding this... I'm learning all the time and wonder how to read this portion of your code "in layman's terms"

 
Code

Plots[0].Min = Lines[0].Value;
Plots[0].Max = Lines[1].Value;
Plots[2].Min = Lines[1].Value;
Plots[3].Max = Lines[0].Value;
I understand the Plots[] part but not the ".Min or .Max" or the "Lines[].Value" with the 0 or 1. My methods have taught me I'd have to do something like this:
 
Code
if (D[0] > Upper)
{
Values[2].Set(D[0]);
}
I'd like to continue learning advance coding techniques whenever I see them.
I appreciate your explanation
thanks in advance.
Kirk

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Cheap historycal L1 data for stocks
Stocks and ETFs
ZombieSqueeze
Platforms and Indicators
What broker to use for trading palladium futures
Commodities
MC PL editor upgrade
MultiCharts
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
  #32 (permalink)
 
roonius's Avatar
 roonius   is a Vendor
 
Posts: 131 since Jun 2009
Thanks Given: 20
Thanks Received: 295


zeller4 View Post
Roonius,

thanks for coding this... I'm learning all the time and wonder how to read this portion of your code "in layman's terms"

 
Code

Plots[0].Min = Lines[0].Value;
Plots[0].Max = Lines[1].Value;
Plots[2].Min = Lines[1].Value;
Plots[3].Max = Lines[0].Value;
I understand the Plots[] part but not the ".Min or .Max" or the "Lines[].Value" with the 0 or 1. My methods have taught me I'd have to do something like this:
 
Code
if (D[0] > Upper)
{
Values[2].Set(D[0]);
}
I'd like to continue learning advance coding techniques whenever I see them.
I appreciate your explanation
thanks in advance.
Kirk

Lines[0] and Lines [0] are the values of the lines you set for overbought oversold areas.

Values[0] correspond to Plots[0]
Values[1] correspond to Plots[1] etc.

Values[] hold actual double values and Plots[] hold plotting properties.

Plots[0].Max = 100 means "Plot Value[0] on the chart if Value[0] is less than 100 otherwise do no plot"

Reply With Quote
Thanked by:
  #33 (permalink)
 zeller4 
Orlando Florida
 
Experience: Intermediate
Platform: NT8
Trading: CL, NQ, ES, RTY
Posts: 477 since Jun 2009
Thanks Given: 1,416
Thanks Received: 404


Thanks Roonius for the explanation.
As I took another look, I noticed the properties section doesn't have code for the Values[2] and [3] as it is for [0] and [1].
 
Code

[Browsable(false)]
[XmlIgnore()]
public DataSeries D
{
get { return Values[0]; }
}
Please tell me why you don't need those there? or why you might decide either way if it's needed or not.
thanks,
kz
Learning All the Time!

Reply With Quote
  #34 (permalink)
 
roonius's Avatar
 roonius   is a Vendor
 
Posts: 131 since Jun 2009
Thanks Given: 20
Thanks Received: 295


zeller4 View Post
Thanks Roonius for the explanation.
As I took another look, I noticed the properties section doesn't have code for the Values[2] and [3] as it is for [0] and [1].
 
Code

[Browsable(false)]
[XmlIgnore()]
public DataSeries D
{
get { return Values[0]; }
}
Please tell me why you don't need those there? or why you might decide either way if it's needed or not.
thanks,
kz
Learning All the Time!

Properties are needed for accessing internal fields -either for setting values or getting values.

In this case:

Values[0] = D
Values[1] = K
Values[2] = D
Values[3] = D

We don't need 3 properties to access the same value.
Values[2] and Values[3] are added just for visualization (color change).

Actually we don't even need the existing properties:

public DataSeries D
{
get { return Values[0]; }
}

What is actually going here is - when we are accessing one property (D), it will pass us a value of another property (Values[0])

It is just for easier understandability for the end user.

Stochastics(3,5,2).D is easier to understand than

Stochastics(3,5,2).Values[0]

Reply With Quote
Thanked by:




Last Updated on October 24, 2009


© 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