Hi!
Been exploring True Range Adjusted EMA in tradestation but i would like to try it on PRT as well, i could not find it in the library so i if someone could convert it to PRT code
https://traders.com/Documentation/FEEDbk_docs/2023/01/TradersTips.html#item1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// TASC JAN 2023
// True Range Adjusted EMA
// Vitali Apirine
inputs:
Periods( 40 ),
Pds( 40 ),
Mltp( 10 );
variables:
Mltp1( 0 ),
Mltp2( 0 ),
Rate( 0 ),
TH( 0 ),
TL( 0 ),
TR ( 0 ),
TRAdj( 0 ),
TRAdjEMA( 0 );
Mltp1 = 2 / (Periods + 1 );
TH = Iff(Close [ 1 ] > High , Close [ 1 ] , High );
TL = Iff(Close [ 1 ] < Low , Close [ 1 ] , Low );
TR = AbsValue(TH - TL);
TRAdj = (TR - Lowest (TR , Pds)) /
(Highest (TR , Pds) - Lowest (TR , Pds));
Mltp2 = TrAdj * Mltp;
Rate = Mltp1* (1 + Mltp2);
if CurrentBar = 1 then
TRAdjEMA = Close
else
TRAdjEMA = TRAdjEMA[ 1 ] + Rate *
(Close - TRAdjEMA[ 1 ] );
Plot1( TRAdjEMA, "TRAdjEMA" );