NexusFi: Find Your Edge


Home Menu

 





Want to create an indicator and have no idea where to start?


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one forrestang with 58 posts (9 thanks)
    2. looks_two ThatManFromTexas with 16 posts (5 thanks)
    3. looks_3 LostTrader with 6 posts (2 thanks)
    4. looks_4 cory with 5 posts (3 thanks)
      Best Posters
    1. looks_one cory with 0.6 thanks per post
    2. looks_two ThatManFromTexas with 0.3 thanks per post
    3. looks_3 LostTrader with 0.3 thanks per post
    4. looks_4 forrestang with 0.2 thanks per post
    1. trending_up 26,142 views
    2. thumb_up 20 thanks given
    3. group 5 followers
    1. forum 93 posts
    2. attach_file 30 attachments




 
Search this Thread

Want to create an indicator and have no idea where to start?

  #31 (permalink)
 
forrestang's Avatar
 forrestang 
Chicago IL
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
Posts: 1,329 since Jun 2010
Thanks Given: 354
Thanks Received: 1,047


forrestang View Post
I'm going back to "Plan A" of trying to reference these indicators from my own script.

Ok, so the goal is to figure out how to get all the Vertical Positions AND colors of the oscilators I am using, and draw items based on those things.

So I figured out the vertical position. The colors cannot be referenced by ninja directly. I was messing around with some print commands in various parts of the ORIGINAL indicators..... I stuck a print command in where I think the various colors might be occuring, and I printed arrows on the chart.

Here you can see the red arrows track the color change of the green/black line in the 2nd pane. The red tracks it perfectly, the green was supposed to be there when the line is green, but it is a bit off.

I don't know how to do it yet, but I wonder if I can take and create a function that I can call WITHIN the original code to make these things easily available to be used outside in MY script I am creating?

Getting closer.

Attached Thumbnails
Click image for larger version

Name:	Prime2011-05-29_003903.jpg
Views:	277
Size:	536.0 KB
ID:	39524  
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
What broker to use for trading palladium futures
Commodities
Trade idea based off three indicators.
Traders Hideout
MC PL editor upgrade
MultiCharts
REcommedations for programming help
Sierra Chart
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
 
  #32 (permalink)
 
forrestang's Avatar
 forrestang 
Chicago IL
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
Posts: 1,329 since Jun 2010
Thanks Given: 354
Thanks Received: 1,047


forrestang View Post

..........Here you can see the red arrows track the color change of the green/black line in the 2nd pane. The red tracks it perfectly, the green was supposed to be there when the line is green, but it is a bit off.

Got it!

Got the ERG(that black/green osc) to reflect when the color changes for UP and DOWN now. So I've got an idea how to track it. I still need to find one more item, and that is the tracking of the color of those price bars you see. That's either up or down.

Then it will just be organizing the data in an easy to read format, and finding a way to make it available OUTSIDE of these original indicators.

Attached Thumbnails
Click image for larger version

Name:	Prime2011-05-29_013347.jpg
Views:	214
Size:	490.8 KB
ID:	39527  
Started this thread Reply With Quote
  #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


Hi Forrestang,

If your ProfTest Code still had this:

 
Code
Overlay = true; 
 
or

if (ProfTradeErg > 10){
DrawArrowUp("arrow"+CurrentBar.ToString(), true, Time[0], Low[0]-2, Color.Green);
} 
 
you ought to add this [CODE*TickSize][/CODE] so it will look like this:
 
Code
if (ProfTradeErg > 10){
DrawArrowUp("arrow"+CurrentBar.ToString(), true, Time[0], Low[0]-2*TickSize, Color.Green);
} 
 

Not sure if you prefer the arrows on the price panel or not, since the horizontal lines from the Initialize section shouldn't be there if you do.

Also, you might want to create your
 
Code

double ProfStrengthHist = ERG_Str1().HIST[0]; //Access to Strength Histo Position
double ProfTradeErg = ERG_Trade().ERG[0]; //Access to Trading Erg Position
double ProfTradeHist = ERG_Trade().HIST[0]; 
as dataseries so that you can reference the prior bar's state. There are ways to use loops to emulate a dataseries (which is over my head). Otherwise, need to find otherways to draw arrows for only when the condition changes (if that's what you prefer to see rather than several continuous bars with the arrow below.

Keep up the good work.

Kirk

Reply With Quote
Thanked by:
  #34 (permalink)
 
forrestang's Avatar
 forrestang 
Chicago IL
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
Posts: 1,329 since Jun 2010
Thanks Given: 354
Thanks Received: 1,047

Thanks Zeller, I had just put the arrows in there so that I could verify that I could get the script to output something when the indicator was doing something. So it was just a flag sort of while I was trying to understand it.

About the data series, that is what I am working on now, so that I can get all the values into my study.

Started this thread Reply With Quote
  #35 (permalink)
 
forrestang's Avatar
 forrestang 
Chicago IL
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
Posts: 1,329 since Jun 2010
Thanks Given: 354
Thanks Received: 1,047


forrestang View Post
....... I still need to find one more item, and that is the tracking of the color of those price bars you see. That's either up or down.

Then it will just be organizing the data in an easy to read format, and finding a way to make it available OUTSIDE of these original indicators.

Believe I found the portion of the script for the color bars. You can see on the chart, I through some arrows on there to visually see it.

Ok, now onto making this into a data series somehow available OUTSIDE the original indicators.

Attached Thumbnails
Click image for larger version

Name:	Prime2011-05-29_231714.jpg
Views:	208
Size:	397.2 KB
ID:	39571  
Started this thread Reply With Quote
  #36 (permalink)
 
forrestang's Avatar
 forrestang 
Chicago IL
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
Posts: 1,329 since Jun 2010
Thanks Given: 354
Thanks Received: 1,047


forrestang View Post

Ok, now onto making this into a data series somehow available OUTSIDE the original indicators.

Can anyone tell me how to create a data series, that will be available to be referenced by any study?

I want to create a data series INSIDE the original indicator, so that I can easily grab it from another study. How should it be declared?

Started this thread Reply With Quote
  #37 (permalink)
 
forrestang's Avatar
 forrestang 
Chicago IL
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
Posts: 1,329 since Jun 2010
Thanks Given: 354
Thanks Received: 1,047


forrestang View Post
Can anyone tell me how to create a data series, that will be available to be referenced by any study?

I want to create a data series INSIDE the original indicator, so that I can easily grab it from another study. How should it be declared?

Indicator: Exposing indicator values that are not plots - [AUTOLINK]NinjaTrader[/AUTOLINK] Support Forum

Maybe this will shed some light on it?

Started this thread Reply With Quote
  #38 (permalink)
 
forrestang's Avatar
 forrestang 
Chicago IL
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
Posts: 1,329 since Jun 2010
Thanks Given: 354
Thanks Received: 1,047



I must still be doing something wrong. I installed that sample study, and tried to get access to the data series in that study from another random study, and I get an error that says:

"NinjaTrader.Indicator.SampleBoolSeries.bullIndication is inaccessible due to its protection level"

I tried to reference it this way:

 
Code
 Print(SampleBoolSeries().bullIndication[0]);

Started this thread Reply With Quote
  #39 (permalink)
 
forrestang's Avatar
 forrestang 
Chicago IL
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
Posts: 1,329 since Jun 2010
Thanks Given: 354
Thanks Received: 1,047


forrestang View Post
I must still be doing something wrong. I installed that sample study, and tried to get access to the data series in that study from another random study, and I get an error that says:

"NinjaTrader.Indicator.SampleBoolSeries.bullIndication is inaccessible due to its protection level"

I tried to reference it this way:

 
Code
 Print(SampleBoolSeries().bullIndication[0]);

Ahah!

To get at that data as a public property, it has to be capitalized.

Started this thread Reply With Quote
  #40 (permalink)
 
forrestang's Avatar
 forrestang 
Chicago IL
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
Posts: 1,329 since Jun 2010
Thanks Given: 354
Thanks Received: 1,047


Ok, I have access to 6 of the 7 variables I need to base my logic on.

I didn't realize it, but the first 6 are "exposed variables" put into data series that are easily available. The 7th variable is the color of the bars, I may have to actually create inside the original indicator?

Here are some pictures, and the arrows are just there to show that I am tracking the state change of each indicator whether it is a color or the level.

Attached Thumbnails
Click image for larger version

Name:	Strength_Histo_Vertical.jpg
Views:	217
Size:	327.7 KB
ID:	39601   Click image for larger version

Name:	Strength_Histo_Color.jpg
Views:	208
Size:	262.0 KB
ID:	39602   Click image for larger version

Name:	Trade_Histo_Vertical.jpg
Views:	199
Size:	394.9 KB
ID:	39603   Click image for larger version

Name:	Trade_Histo_Color.jpg
Views:	240
Size:	240.8 KB
ID:	39604   Click image for larger version

Name:	Trade_ERG_Vertical.jpg
Views:	221
Size:	181.1 KB
ID:	39605   Click image for larger version

Name:	Trade_ERG_Color.jpg
Views:	219
Size:	301.1 KB
ID:	39606  
Started this thread Reply With Quote
Thanked by:




Last Updated on January 20, 2012


© 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