PTS Logo

PLA Dynamical open code for Tradestation and MultiCharts for creating.

Sitemap

 

How to use PLA Dynamical GOLD function to create signals and indicator

 


Precision Trading Systems has provided two methods to do this. Please read very carefully to avoid errors.

Beginners please note that text with // on the far left of it makes the text un-readable to a computer in EasyLanguage code

// This text would appear in green font as "notations" to help you follow what each stage of code is doing

PLA Dynamical Tradestation VIDEO page  "TS" 

PLA Dynamical MultiCharts VIDEO page "MC"


Method 1.

If you are doing something simple, then this is the best choice for you.

In the inputs settings you can see PRICE. The default value of price is CLOSE.

However this can simply be changed to represent the indicator you want to smooth with PLA Dynamical GOLD moving average.

Example 1. Smoothing RSI

Plot PLA Dynamical on the chart and select sub graph 2 from the properties tab.

In the inputs box click on Price and type in

RSI(CLOSE, 30) then click ok

The plot in sub graph 2 will then be a smoothed RSI of length 30 which reads the closing price.

You can then modify PLA Dynamical lengths, speed and overshoot functions to fit your requirements.

If you want to reduce RSI length to 10, and read from the median price then simple type in

RSI(MEDIANPRICE, 10) then click ok

Example 1. Smoothing CCI

Plot PLA Dynamical on the chart and select sub graph 2 from the properties tab.

In the inputs box click on Price and type in

CCI(30) then click ok



Method 2.


If you are doing something more complex such as creating a signal or function or indicator using PLA Dynamical GOLD then this method is correct.

Example of creating an indicator with two plot from PLA Dynamical GOLD

PLA Dynamical GOLD has the following syntax to use for programming.

PLA_D_GOLD_Func_v1.00(length, price, speed, overshoot,anti_reverse,anti_rev_per);

All the parts must be assigned a value for it to work correctly.



Below is an example piece of code that is used to smooth two different length RSI indicators with PLA Dynamical GOLD showing in 1 window.


In power language editor in MC or Development environment in TS, click on file new indicator , type in a name EG My_smooth_PLA_RSI and copy the code below into the open

window and click compile.

It will then be shown in your indicator list

Inputs: Length(40), speed(40), overshoot(1), anti_reverse(1),anti_rev_per(0.01);

vars: smoothpla1(0),smoothpla2(0),indicator1(0),indicator2(0);

indicator1 = rsi(c,20);
indicator2= rsi(c,50);


smoothpla1= PLA_D_GOLD_Func_v1.00(length,indicator1,speed,overshoot,anti_reverse,anti_rev_per);

smoothpla2= PLA_D_GOLD_Func_v1.00(length,indicator2,speed,overshoot,anti_reverse,anti_rev_per);


PLOT1(smoothpla1,"TEST");
PLOT2(smoothpla2,"TEST2");

The variables called indicator1 and indicator2 can be changed to suit what you require.

In the example above you can notice the "price" input has been removed and replayed in the syntax by "indicator1"

smoothpla1= PLA_D_GOLD_Func_v1.00(length,indicator1,speed,overshoot,anti_reverse,anti_rev_per);

The important thing is to get the variables in the correct order.



Sample code to use PLA Dynamical GOLD as a function

Functions can be used to be "called" by other indicators, signals or other functions.

In the example I will make PLA Dynamical GOLD into a binary trend function which you can call.

If the indicator is rising it will return +1 and if it is falling it will return -1 ( this is to indicate a major trend )

Click on file new function, numeric and name it TEST_PLA_TREND

Copy the code below and click compile. You have now created the function.
 
Inputs: Length(Numeric),PRICE(Numeric),speed(Numeric), overshoot(Numeric), anti_reverse(Numeric),anti_rev_per(Numeric);

vars: PLA(0);

pla= PLA_D_GOLD_Func_v1.00(length,price,speed,overshoot,anti_reverse,anti_rev_per);

if pla > pla[1] then TEST_PLA_TREND =1;
if pla < pla[1] then TEST_PLA_TREND =-1;



Now we can proceed to make a custom indicator that will call from this function

Click on file new Indicator and name it TEST_PLA_TREND ( Or call it anything you want )

Copy the code below and click compile. You have now created the indicator that measures trend as +1 or -1.



Inputs: Length(100),Price(c),speed(40), overshoot(1), anti_reverse(1),anti_rev_per(0.01);

vars: PLA_TREND(0);

PLA_TREND= TEST_PLA_TREND(LENGTH,PRICE,
SPEED,OVERSHOOT,ANTI_REVERSE,ANTI_REV_PER);



PLOT1(PLA_TREND,"PLA_TREND");

Now we can proceed to plot the indicator on the chart. It will appear in your indicator list.

Choose subgraph 2 when you add it to the chart.

Uptrend is defined as +1 and downtrend is defined as -1

Now we can make a simple strategy signal which uses this is a trend filter.

We will use length 100 to signify a major trend and the buy signals will be given from length 30 PLA Dynamical GOLD rising compared to the value of the previous bar.

Click on file new signal , Type the name for it as PLA_TREND_FILTER

Copy the code below and use it for your trading.


Then finally you can use the function you created above in the below code which is exceptionally effective as you will discover.

PLA Double trend code







Now you can add the signal to the chart to see how it works.

Notice in the variable TEST_PLA_TREND I have fixed the variables for speed to 50 and overshoot to 0.

If you want to change them you can type different values into those place.



More simple to understand examples of using easy language code on this page 

Suitable for beginners and experts as the code is unusual and innovative.
 
 
 

-



Some amazing trading stories can be found here.


Some interesting philosophical quotes can be found here.


Trading IQ Game with PTS products as prizes


Risk management in the sense of protection from market crashes with guidelines on stops to enter shorts.


Optimal trade size for maximum gains


Beginners and intermediate traders guide tutorial in six parts with examples and diagrams

-

 

The help and advice of customers is valuable to me. Have a suggestion? Send it in!

The contact page here has my email address and you can search the site

 

BACK TO TOP OF PAGE - Go slowly and don't crash into any items on the way up 

 

 If you like what you see, feel free to SIGN UP  to be notified of new products - articles -

 less than 10 emails a year and ZERO spam and ZERO hard selling

About

Precision Trading Systems was founded in 2006 providing high quality indicators and trading systems for a wide range of markets and experience.

Supporting NinjaTrader, Tradestation. MultiCharts, TradingView, MetaTrader 4 and very soon MT5

 

 

Bio
The PTS Logo
Admin notes
Page modernized on Dec 15th 2023 to replace old page from 2016   -  New responsive page GA4 added canonical this. 5/5 html sm links added - responsive- 17 hours no food fasting moment with clear mind today