Indicator Problem - Question - NinjaTrader Programming | futures io social day trading
futures io futures trading


Indicator Problem - Question
Updated: Views / Replies:701 / 5
Created: by mk77ch Attachments:3

Welcome to futures io.

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

futures io is the largest futures trading community on the planet, with over 100,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors – all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you don’t need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

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

Reply
 
Thread Tools Search this Thread
 

Indicator Problem - Question

  #1 (permalink)
Elite Member
Switzerland
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: Dorman
Favorite Futures: Currency Futures, ES
 
mk77ch's Avatar
 
Posts: 79 since Oct 2010
Thanks: 12 given, 65 received

Indicator Problem - Question

Hello,

Im new to Ninjatrader Programming and today i tried to convert a MetaTrader 4 Indicator to Ninjatrader 7.
When i attach the indicator to a chart, it looks good but with each new bar the values getting wrong.

The MT4 Source Code can be found here: TSI MACD - MQL4 Code Base (TSI_MACD_true, scroll down)

I attached the NT Indicator i made.

I guess the problem is located in the definition of the current bar [0] and [-1] but i really dont know what exactly is wrong.

 
Code
rawMtmBuffer[0] = MACD(fast,slow,signal)[0] - MACD(fast,slow,signal)[-1];
absMtmBuffer[0] = Math.Abs(rawMtmBuffer[0]);
				
emaRawMtmBuffer[0] = EMA(rawMtmBuffer,first_R)[0];
emaAbsMtmBuffer[0] = EMA(absMtmBuffer,first_R)[0];
				
ema2RawMtmBuffer[0] = EMA(emaRawMtmBuffer,second_S)[0];
ema2AbsMtmBuffer[0] = EMA(emaAbsMtmBuffer,second_S)[0];
				
if(ema2AbsMtmBuffer[0] != 0.0)
{
    tsiBuffer[0] = -100.0 * (ema2RawMtmBuffer[0] / ema2AbsMtmBuffer[0]);
}
				
signalBuffer[0] = WMA(tsiBuffer,signalPeriod)[0];
				
TsiMacd.Set(tsiBuffer[0]);
TsiSignal.Set(signalBuffer[0]);
it would be great if somebody of you could give me a hint how i could fix this.

thank you!
mike

Attached Files
Register to download File Type: zip fxuTsiMacd.zip (8.1 KB, 5 views)

Last edited by mk77ch; April 5th, 2013 at 03:05 PM. Reason: added the right indicator...
Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Elite Member
Cedar Rapids, iowa
 
Futures Experience: Intermediate
Platform: Ninjatrader
Broker/Data: Ninjatrader - Continuum
Favorite Futures: 6E, TF, 6J
 
Tasker_182's Avatar
 
Posts: 626 since Aug 2009
Thanks: 426 given, 1,131 received


Zero refers to the current bar, 1 refers to the previous bar, -1 refers to a future bar. Are you trying to predict the future? <grin>.

Reply With Quote
 
  #4 (permalink)
Elite Member
Switzerland
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: Dorman
Favorite Futures: Currency Futures, ES
 
mk77ch's Avatar
 
Posts: 79 since Oct 2010
Thanks: 12 given, 65 received


Tasker_182 View Post
Zero refers to the current bar, 1 refers to the previous bar, -1 refers to a future bar. Are you trying to predict the future? <grin>.

thank you very much that fixed the problem ;-)
i attach the working indicator here so maybe someone find it useful.

cheers,
mike

Attached Files
Register to download File Type: zip fxuTsiMacd.zip (8.1 KB, 19 views)
Reply With Quote
The following 2 users say Thank You to mk77ch for this post:
 
  #5 (permalink)
Elite Member
Portland Oregon, United States
 
Futures Experience: Beginner
Platform: Ninjatrader®
Broker/Data: CQG, Kinetick
Favorite Futures: Gameplay Klownbine® Trading of Globex
 
Zondor's Avatar
 
Posts: 1,331 since Jul 2009
Thanks: 1,246 given, 2,661 received

tsi not coded efficiently

I made some changes that will tremendously improve its performance.

There is information about efficient coding in this thread.

https://futures.io/ninjatrader-programming/3565-anyone-have-any-hints-optimizing-c-code-4.html#post42205

"If we don't loosen up some money, this sucker is going down." -GW Bush, 2008
“Lack of proof that something is true does not prove that it is not true - when you want to believe.” -Humpty Dumpty, 2014
“The greatest shortcoming of the human race is our inability to understand the exponential function.”
Prof. Albert Bartlett
Attached Files
Register to download File Type: cs fxuTsiMacd.cs (11.3 KB, 29 views)
Reply With Quote
The following 4 users say Thank You to Zondor for this post:
 
  #6 (permalink)
Elite Member
Switzerland
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: Dorman
Favorite Futures: Currency Futures, ES
 
mk77ch's Avatar
 
Posts: 79 since Oct 2010
Thanks: 12 given, 65 received


Zondor View Post
I made some changes that will tremendously improve its performance.

There is information about efficient coding in this thread.

https://futures.io/ninjatrader-programming/3565-anyone-have-any-hints-optimizing-c-code-4.html#post42205

thank you very much!
as im new to ninjatrader coding this helps a lot!

cheers,
mike

Reply With Quote

Reply



futures io > > > > > Indicator Problem - Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

July Journal Challenge - $500 in Amazon Gift Cards!

July
 

AXESS Trader: Powerful Cloud Based Trading Platform w/GFF Brokers

Jul 17

TBA: FuturesTrader71 w/Morad Askar

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
VWAP SESSION NT indicator problem babypowder NinjaTrader 9 March 31st, 2014 03:43 PM
True Strength Indicator/Easy Language programming problem eseeker EasyLanguage Programming 18 August 2nd, 2012 12:16 PM
NT VolumeStop indicator problem h20polo NinjaTrader 3 May 24th, 2011 05:44 PM
Felton Trader indicator down load problem. Thanks hector24 The Elite Circle 18 April 8th, 2011 08:34 AM
NT Platform problem/question GarryM NinjaTrader Programming 8 September 9th, 2009 10:48 PM


All times are GMT -4. The time now is 06:17 PM. (this page content is cached, log in for real-time version)

Copyright © 2018 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, 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
Page generated 2018-07-17 in 0.11 seconds with 15 queries on phoenix