NexusFi: Find Your Edge


Home Menu

 





using History on NT Indicator


Discussion in NinjaTrader

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




 
Search this Thread

using History on NT Indicator

  #1 (permalink)
siscop
germany
 
Posts: 19 since Sep 2009
Thanks Given: 16
Thanks Received: 4

Hi,
I wanted to “convert” one of my MT4 Indicator to Ninjatrader but I can’t seem to find my problem here.

protected override void OnBarUpdate()
{
Dkurz.Set(High[0]);
Dlang.Set(Low[0]);
double[] kurz= new double[Periode];
kurz[1]=Close[1];
}

I could filter my problem to this line.
“kurz[1]=Close[1];”
If I write “kurz[1]=Close[0];” it works but I want to use history data for my indicator. As soon I write Close[1] my indicator does not show.
Can someone give me a hint why my Indicator does not allow history data?
This should be a noob question an hope someone can enlight me :-)

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Trade idea based off three indicators.
Traders Hideout
Increase in trading performance by 75%
The Elite Circle
Better Renko Gaps
The Elite Circle
How to apply profiles
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
36 thanks
Tao te Trade: way of the WLD
24 thanks
Spoo-nalysis ES e-mini futures S&P 500
21 thanks
Bigger Wins or Fewer Losses?
19 thanks
GFIs1 1 DAX trade per day journal
16 thanks
  #2 (permalink)
siscop
germany
 
Posts: 19 since Sep 2009
Thanks Given: 16
Thanks Received: 4

just to make it clear
I get this with Close[0]
danicht.JPG

This is when I write Close[1]
nichts.JPG

Attached Thumbnails
Click image for larger version

Name:	danicht.JPG
Views:	357
Size:	93.8 KB
ID:	4535   Click image for larger version

Name:	nichts.JPG
Views:	341
Size:	81.5 KB
ID:	4536  
Reply With Quote
  #3 (permalink)
 
cory's Avatar
 cory 
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,090


one of mistake a coder makes often is forgetting to wait for enough data
for example if you want to refer to bar[6] then you have to have this coding first

protected override void OnBarUpdate()
{
if (CurrentBar < 6)
return;

----------

you may want to try


protected override void OnBarUpdate()
{
if (CurrentBar < 1)
return;

Reply With Quote
Thanked by:
  #4 (permalink)
siscop
germany
 
Posts: 19 since Sep 2009
Thanks Given: 16
Thanks Received: 4

Thank you sooooo much. It works now :-)

Reply With Quote




Last Updated on November 15, 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