Bangkok + Thailand
Posts: 10 since Aug 2012
Thanks Given: 2
Thanks Received: 0
|
Hi Everyone,
I have not been active online for some time (but I have been trading. Forex and volatility mostly) and I believe it is time for me to start toying with something else than excel...
Initially I wanted to learn some C# and get started on MC .Net but I quickly realized that NinjaTrader looked more approachable.
So here I am: trying to code my first indicator (smoothed RsRank, to change the color of my chart depending on whether it is a Bull/Bear market regimes as described here: //systemtradersuccess.com/trend-testing-indicators ).
The idea would be for me to try some strategies using DV2 and RSI2 as Entry points while looking at the current market regime using RsRank or TSI (something along that line: //adaptivetrader.wordpress.com/2012/09/29/dv2-indicator/)
Replicating some youtube tutorials was fun and all but coding something (as simple as a smoothed RsRank) is not easy.
This is what I have done:
New ninjascript (indicator)
created 2 variables : LT_Close and ST_Close, values: 140 and 20 respectively
and in the OnBarUpdate:
double RsRank = ( ( Close[0] - LT_Close + Close[0] - ST_Close ) / 2 ) / ATR[10];
Even at this early stage, the code doesnt compile... (then I would have to smooth it as described in the link above of course)
Any pointer would be really appreciated (any book with examples or projects on how to learn coding with Ninjatrader available??)
Thanks in advance!
Alex
|