Simple Tradestation code into Wave59 - Help

Have a QScript to share, or need help with programming? Post your comment here.
Post Reply
sherlock
Posts: 5
Joined: Tue Jul 21, 2015 8:56 pm
Contact:

Simple Tradestation code into Wave59 - Help

Post by sherlock » Tue Apr 21, 2020 9:17 pm

Hi to all, its been a few years since I last posted, but wanted to come back and checkout W59 again.....

I hoping someone can convert these two Tradestation scripts into Qscript, so I can move my trading back to W59..

I wish I could code...

These are standard indicators, but the script below plots on the bar, rather than the traditional wave at the bottom of the chart.... I find it easier to trade.

Big thanks for your help...

INDICATOR: “ST Low ADX”

This simple indicator paints bars if the ADX falls below a threshold. ADX is calculated of the last X number of bars.

The defaults used here are: White if ADX falls below 15, calculated over the last 14 bars.
------------------------------------------------------------------------------------------

If CurrentBar > 1 Then Begin


if ADX(14) <= 15
then PlotPaintBar (High, Low, Open, Close, "ADX", white);


End;
------------------------------------------------------------------------------------------

INDICATOR: “ST ATR Low”

This indicator paints bars if the bar is at least 25% smaller than the ATR of the last X number of bars.

The defaults used here are: BLUE if bar is at least 25% smaller than the ATR of the last 14 bars.

--------------------------------------------------------------------------------------------

inputs: ATRLength( 14 ), SmallColour(red), SmallFactor(0.75) ;

variables: ATR( 0 ) ;

ATR = AvgTrueRange( ATRLength ) ;

if TrueRange<=SmallFactor*ATR then PlotPaintBar(High, Low, Open, Close,
"ATR", SmallColour);
---------------------------------------------------------------------------------------------

User avatar
earik
Site Admin
Posts: 474
Joined: Mon Dec 01, 2014 12:41 pm
Contact:

Re: Simple Tradestation code into Wave59 - Help

Post by earik » Tue May 12, 2020 9:53 pm

Hi sherlock,

Here's the first one:

Code: Select all

input:color(white),width(2);
if (adx(14)<=15)
    colorbar(barnum,color,width);
And here's the second:

Code: Select all

inputs: ATRLength( 14 ), SmallColour(red), SmallFactor(0.75), width(2) ;

TR = truerange();
ATR = average(TR, ATRLength ) ;
                   
if (TR<=SmallFactor*ATR) {
    colorbar(barnum,SmallColour,width);
}  


When you build these, just open the script editor (Scripts - QScript Editor), paste them in (one at a time), and click QScript - Script Properties. Give it a name, set the scaling to "screen" (for both), then click QScript - Build script. The scripts will show up in the "technicals" menu for you. Note that I've added a "width" input. Use that to make your color bars thicker or smaller.

Regards,

Earik

Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests