Trading Articles
Article Categories
Article Tools
Indicator Conversion from ThinkScript to NinjaScript
Updated May 31, 2023
trending_up
563 views
thumb_up
0 thanks given
group
4 followers
forum
1 posts
attach_file
1 attachments
Welcome to futures io: the largest futures trading community on the planet, with well over 150,000 members
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
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
(If you already have an account, login at the top of the page)
Indicator Conversion from ThinkScript to NinjaScript
(login for full post details)
#1 (permalink )
Austin, TX
Experience: Intermediate
Platform: NinjaTrader, TOS
Broker: TOS, NinjaTrader, IBKR
Trading: Futures
Posts: 1 since Apr 2011
Thanks: 0 given,
0
received
I have a small ThinkScript indicator that I would like to convert to NinjaScript. I got started but I would like some assistance from someone who is better versed in doing such conversions. Thanks in advance.
declare once_per_bar;
def NetChgAvg = MovingAverage(AverageType.WILDERS, close - close[1], 14);
def theta = GetYYYYMMDD();
def LRV = Inertia(close - ((Highest(high, 20) + Lowest(low, 20)) / 2 + ExpAverage(close, 20)) / 2, 20);
def Value = MovingAverage(AverageType.EXPONENTIAL, close, 10) - MovingAverage(AverageType.EXPONENTIAL, close, 50);
def Avg = MovingAverage(AverageType.EXPONENTIAL, Value, 9);
def periodIndx = theta;
def isPeriodRolled = CompoundValue(1, periodIndx != periodIndx[1], yes);
def volumeSum;
def volumeVwapSum;
def volumeVwap2Sum;
if (isPeriodRolled) {
volumeSum = volume;
volumeVwapSum = volume * vwap ;
volumeVwap2Sum = volume * Sqr(vwap);
} else {
volumeSum = CompoundValue(1, volumeSum[1] + volume, volume);
volumeVwapSum = CompoundValue(1, volumeVwapSum[1] + volume * vwap, volume * vwap);
volumeVwap2Sum = CompoundValue(1, volumeVwap2Sum[1] + volume * Sqr(vwap), volume * Sqr(vwap));
}
def VWAP = volumeVwapSum / volumeSum;
def RTH = if SecondsTillTime(1600) >= 0 and SecondsFromTime(925) >= 0 then 1 else 0;
def bulltrend = if ((Value > 0 and Avg > 0)) and (LRV > 0 and NetChgAvg > 0) and close[1] > VWAP[1] and close > VWAP then 1 else 0;
def beartrend = if ((Value < 0 and Avg < 0)) and (LRV < 0 and NetChgAvg < 0) and close[1] < VWAP[1] and close < VWAP then 1 else 0;
AssignPriceColor(if bulltrend then Color.GREEN else if beartrend then Color.RED else Color.BLUE);
Can you help answer these questions from other members on futures io?
Best Threads (Most Thanked) in the last 7 days on futures io
(login for full post details)
#2 (permalink )
Anthem, AZ
Experience: Intermediate
Platform: NinjaTrader8
Trading: Futures
Posts: 77 since Aug 2020
Thanks: 5 given,
126
received
may give it a try but not sure .. this looks beyond my capability
looks like you will need the Welles Wilder Moving Average .. found it here
.. you don't have to be the first one at the party .. just be part of the party ..
Last Updated on May 31, 2023