NexusFi: Find Your Edge


Home Menu

 





Converting code from Tradestation/ Plots Swing Point Highs/Lows


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one kris123 with 5 posts (0 thanks)
    2. looks_two wbtrader with 2 posts (1 thanks)
    3. looks_3 TigerStripes with 2 posts (0 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 10,798 views
    2. thumb_up 5 thanks given
    3. group 5 followers
    1. forum 11 posts
    2. attach_file 4 attachments




 
Search this Thread
  #1 (permalink)
 wbtrader 
atlanta ga usa
 
Experience: Advanced
Platform: tradestation, ninja trader
Trading: es
Posts: 12 since Aug 2011
Thanks Given: 10
Thanks Received: 5

would anyone be able to help with converting code from Tradestation into Ninja Trader?
inputs:
MALength( 20 ),
Price( Close ),
UseGradientColor( true ),
NegGradColor( Red ),
PosGradientColor( Green ) ;

variables:
MAValue( 0 ),
MASlope( 0 ),
MAAngle( 0 ) ;

MAValue = AverageFC( Price, MALength ) ;

MASlope = ( MAValue - MAValue[1] ) * (PriceScale / MinMove ) ;

MAAngle = ArcTangent( MASlope ) ;

if UseGradientColor then
SetPlotColor( 1, GradientColor( MAAngle, -90, 90, NegGradColor, PosGradientColor )) ;

Plot1( MAAngle, "MA Angle" ) ;


"All Things Are Possible Thru Christ"
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
UMA Votes Tonight: Polymarkets $80M Strategy Bitcoin Bat …
Prediction Markets & Event Contracts
Cboe Files for Near 24x5 Equities Trading -- December 20 …
Traders Hideout
The Week Ahead -- CPI Wednesday With Oil Past $90, PPI L …
Traders Hideout
MegaETH Proves the Crowd Right: Prediction Markets Calle …
Prediction Markets & Event Contracts
Topstep Acquires The Futures Desk -- Prop Firm Consolida …
Funded Trading Evaluation Firms
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
21 thanks
2026 Jlab journal
10 thanks
Trying to learn Volume and price action correlation
8 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Lady Vols Primer: Trading Volatility Journal
5 thanks
  #3 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Interactive Brokers
Trading: Futures & Stocks
Posts: 9,887 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,114


You could look at various zigzag indicators, which are already available for NinjaTrader. Also, If you define swing highs and lows, there are two different concepts:

(a) define a high or low as a bar with a higher high or lower low than the n surrounding bars (strenght n)

(b) define highs and lows based on a zigzag with a minimum deviation

I prefer the method which uses the minimum deviation, as it will not plot a large number of useless highs and lows in a choppy market which is going nowhere.

But the best method obviously depends on what you want to do with those highs and lows, and then you did not tell us.


Reply With Quote
Thanked by:
  #4 (permalink)
 wbtrader 
atlanta ga usa
 
Experience: Advanced
Platform: tradestation, ninja trader
Trading: es
Posts: 12 since Aug 2011
Thanks Given: 10
Thanks Received: 5

sorry i didnt tell the whole story. i am wanting to use these as confirmation entries. this is what the idea of it is and this is posted above in the code.
"This plots swing highs/lows with a strength of 2 bars on each side, on the condition that there is a
close above/below the high/low the bar after the said swing bar."

i simply want it to plot a dot whenever this occurs. it can plot the dot when you get the close within 2 bars of said swing high/low bar with a strength of 2 bars on each side. hope this helps.
it is simply meant to trigger an entry and it also plots the price of the swing high/low when it plots so you know where to place your stop. you can see the pic attached to get the idea. thanks!!!


"All Things Are Possible Thru Christ"
Attached Thumbnails
Click image for larger version

Name:	Swing High Low.jpg
Views:	647
Size:	96.5 KB
ID:	50288  
Started this thread Reply With Quote
Thanked by:
  #5 (permalink)
famgomlop
San Felipe BC/Mexico
 
Posts: 1 since May 2012
Thanks Given: 0
Thanks Received: 1

Try this pivot points, I'm sure probably is not exactly as in Tradestation, which I have too, bute it gives prettty much the same result for buy/sell decision


Attached Files
Elite Membership required to download: PivotPoints.zip
Reply With Quote
Thanked by:
  #6 (permalink)
 kris123 
Mumbai
 
Experience: Intermediate
Platform: meta
Trading: ES
Posts: 10 since Jan 2013
Thanks Given: 0
Thanks Received: 0

Can you someone please provide the Tradestation Code that creates the Swing Dots as mentioned by the starter of this post ?

BIG-DOTS


Reply With Quote
  #7 (permalink)
 TigerStripes   is a Vendor
 
Posts: 109 since Mar 2021
Thanks Given: 33
Thanks Received: 57


kris123 View Post
Can you someone please provide the Tradestation Code that creates the Swing Dots as mentioned by the starter of this post ?

BIG-DOTS

The NT8 Swing indie can do that and continues to add dots until the high or swing low is invalidated by price moving passed the Swing point.


Reply With Quote
  #8 (permalink)
 kris123 
Mumbai
 
Experience: Intermediate
Platform: meta
Trading: ES
Posts: 10 since Jan 2013
Thanks Given: 0
Thanks Received: 0

Thanks for the pointer. Do you have a link for that NT8 Swing Indicator you were referring to ?


Reply With Quote
  #9 (permalink)
 TigerStripes   is a Vendor
 
Posts: 109 since Mar 2021
Thanks Given: 33
Thanks Received: 57


kris123 View Post
Thanks for the pointer. Do you have a link for that NT8 Swing Indicator you were referring to ?

SWING is a base indie in the install of NT8.


Reply With Quote
  #10 (permalink)
 kris123 
Mumbai
 
Experience: Intermediate
Platform: meta
Trading: ES
Posts: 10 since Jan 2013
Thanks Given: 0
Thanks Received: 0


Got it. Just nstalled and checked .Quite an useful Indicator. Thanks again.


Reply With Quote




Last Updated on October 25, 2022


© 2026 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 - Downloads - Top
no new posts