futures io



Indicator Conversion from ThinkScript to NinjaScript


Discussion in Traders Hideout

Updated
    1. trending_up 563 views
    2. thumb_up 0 thanks given
    3. group 4 followers
    1. forum 1 posts
    2. 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)

 
Search this Thread
 

Indicator Conversion from ThinkScript to NinjaScript

(login for full post details)
  #1 (permalink)
 powerballretire 
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);

Attached Thumbnails
Click image for larger version

Name:	Screen Shot 2023-04-18 at 6.04.02 PM.png
Views:	90
Size:	55.6 KB
ID:	331078  
Started this thread Reply With Quote

Can you help answer these questions
from other members on futures io?
Export Bloodhound Performance Report?
NinjaTrader
About Automated Trading from Watch List
MultiCharts
Mt5 Tradestation Integration
TradeStation
Rival systems and Exegy
Platforms and Indicators
Need a bit of help putting pieces together :)
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Big Mike in Ecuador
42 thanks
top trading courses
13 thanks
futures io site changelog and issues/problem reporting
11 thanks
Trader Sentiment Tool for our community
11 thanks
Hedge your losers to turn them into winners
10 thanks

 
(login for full post details)
  #2 (permalink)
 mewddsltd 
Anthem, AZ
 
Experience: Intermediate
Platform: NinjaTrader8
Trading: Futures
 
mewddsltd's Avatar
 
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 ..
Reply With Quote


futures io Trading Community Traders Hideout > Indicator Conversion from ThinkScript to NinjaScript


Last Updated on May 31, 2023



Copyright © 2023 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada), 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