NexusFi: Find Your Edge


Home Menu

 





EasyLanguage ADXVMA Indicator


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one Big Mike with 5 posts (18 thanks)
    2. looks_two swisstrader with 5 posts (0 thanks)
    3. looks_3 syxforex with 2 posts (0 thanks)
    4. looks_4 thatguy with 2 posts (0 thanks)
    1. trending_up 15,156 views
    2. thumb_up 32 thanks given
    3. group 8 followers
    1. forum 15 posts
    2. attach_file 3 attachments




 
Search this Thread

EasyLanguage ADXVMA Indicator

  #1 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,446 since Jun 2009
Thanks Given: 33,217
Thanks Received: 101,610

Here is the ADXVMA function and indicator for EasyLanguage - TradeStation/MultiCharts. I am unsure of the original author, this is a conversion from NinjaTrader.

I've built it as a function so you can use it in signals easily. The attached .pla MultiCharts file is both the function and the indicator.

I know that some NT users like to set the rising and falling plots to transparent so they are left with "shelfs" for the neutral plot. I tried, but there is apparently no way to do this in EasyLanguage. I've emailed MultiCharts for help.

[img]https://nexusfi.com/v/jgy69s.png[/img]

Function:
 
Code
                            
// Big Mike Trading https://nexusfi.com

// April 17 2010
// Converted from NinjaTrader version, original author unknown
// Function

inputs:     
    
Price (NumericSeries),
    
Length (NumericSimple);

vars:
    
TR(0),
    
DI_Diff(0),
    
DI_Sum(0),
    
ma(0),
    
pdm(0),
    
mdm(0),
    
pdi(0),
    
mdi(0), 
    
DI_Factor(0), 
    
VI(0), 
    
diff(0), 
    
HHV(0), 
    
LLV(0),
    
WeightDM(Length), 
    
WeightDI(Length), 
    
WeightDX(Length),
    
ChandeEMA(Length),
    
out(0),
    
j(0);

once ma=Price;    

if(
Price>Price[1]) then pdm=Price-Price[1] else mdm=Price[1]-Price;//This array is not displayed.

pdm=((WeightDM-1)*pdm[1] + pdm)/WeightDM;//ema.
mdm=((WeightDM-1)*mdm[1] + mdm)/WeightDM;//ema.

TR=pdm+mdm;

if (
TR>0then begin    pdi=pdm/TRmdi=mdm/TRend
 
else begin
    pdi
=0;
    
mdi=0;
end;

pdi=((WeightDI-1)*pdi[1] + pdi)/WeightDI;//ema.
mdi=((WeightDI-1)*mdi[1] + mdi)/WeightDI;//ema.
DI_Diff=pdi-mdi;
  
if (
DI_Diff<0then  DI_Diff= -DI_Diff;//Only positive momentum signals are used.

DI_Sum=pdi+mdi;
DI_Factor=0;//Zero case, DI_Diff will also be zero when DI_Sum is zero.

if (DI_Sum>0then out=DI_Diff/DI_Sum else out=0;

out=((WeightDX-1)*out[1] + out)/WeightDX;

if (
out>out[1]) then begin HHV=outLLV=out[1]; end 
 
else begin
    HHV
=out[1];
    
LLV=out;
end;

for 
1 to Length-1 begin    
    
if(out[j+1]>HHV)then HHV=out[j+1];
    if(
out[j+1]<LLVthen LLV=out[j+1];
end;

diff HHV LLV;
VI=0;

if (
diff>0then  VI=(out-LLV)/diff;
          
ma=((ChandeEMA-VI)*ma[1]+VI*Price)/ChandeEMA;//Chande VMA formula with ema built in.

ADXVMA ma
Indicator:
 
Code
                            


// Big Mike Trading https://nexusfi.com
// April 17 2010
// Indicator

inputs:
    
Price (close),
    
length (14);
    
vars:
    
av (0);
    
av ADXVMA(Pricelength);

Plot1(av"Rising");
Plot2(av"Falling");
Plot3(av"Neutral");
Plot4(av"ADXVMA"iff(av av[1], GetPlotColor(3), iff(av av[1], GetPlotColor(1), GetPlotColor(2))));

NoPlot(1);
NoPlot(2);
NoPlot(3); 
Attached is the .pla for MultiCharts.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Attached Files
Elite Membership required to download: ADXVMA.pla
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
How to apply profiles
Traders Hideout
NexusFi Journal Challenge - May 2024
Feedback and Announcements
Better Renko Gaps
The Elite Circle
ZombieSqueeze
Platforms and Indicators
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
48 thanks
Just another trading journal: PA, Wyckoff & Trends
35 thanks
Tao te Trade: way of the WLD
25 thanks
Bigger Wins or Fewer Losses?
24 thanks
GFIs1 1 DAX trade per day journal
21 thanks
  #3 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,446 since Jun 2009
Thanks Given: 33,217
Thanks Received: 101,610


If you set Rising and Falling to your chart background color (ie: black), and change ADXVMA plot to Point instead of line, it works "fairly well" (not perfect).

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #4 (permalink)
 thatguy 
New Brunswick, NJ
 
Experience: Intermediate
Platform: N/A
Trading: N/A
Posts: 133 since Jun 2009
Thanks Given: 46
Thanks Received: 157

You can probably use an input flag and if set to true only plot when av = av[1]. If set to false, plot everything.

Reply With Quote
  #5 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,446 since Jun 2009
Thanks Given: 33,217
Thanks Received: 101,610


thatguy View Post
You can probably use an input flag and if set to true only plot when av = av[1]. If set to false, plot everything.

Thx.

I tried something similar to that, the problem is that unless you choose a Point plot, the lines from bar X will be connected to bar Y, even for just the neutral plot (av = av[1]). Using point/dot is not a show stopper, but it seems they really need a transparent method.

I'm going to leave it be because I don't really use this indicator, but you guys should improve it and share it back

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #6 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,446 since Jun 2009
Thanks Given: 33,217
Thanks Received: 101,610

Hey guys, I was playing with another indicator tonight and realized I had a real simple way to make ADXVMA plot just the 'support and resistance' lines that many of you like (as opposed to the falling/rising lines).

Here is the new EasyLanguage code. You might want to create a new Indicator name for this version, like "ADXVMA SR Only" for instance, to keep the original indicator intact:

 
Code
                            
inputs:

    
Price (close),
    
length (14);
    
vars:
    
av (0),
    
lastav (0);
    
av ADXVMA(Pricelength);

if 
av av[1then lastav av;
Plot1(lastav"ADXVMA"); 
Here are some screen shots. You can see it just plots the last S/R line only.

[img]https://nexusfi.com/v/u5vkdp.png[/img]

[img]https://nexusfi.com/v/qk6t6g.png[/img]

Let me know if its useful.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #7 (permalink)
 syxforex 
British Columbia
 
Experience: Advanced
Platform: NINJA
Broker: ZEN
Trading: Crude
Posts: 1,091 since May 2010

Hi Mike,

I was trying to find out what exactly adxvma is, can't seem to google it, could you explain the calculation?

Thanks,



Big Mike View Post
Hey guys, I was playing with another indicator tonight and realized I had a real simple way to make ADXVMA plot just the 'support and resistance' lines that many of you like (as opposed to the falling/rising lines).

Here is the new EasyLanguage code. You might want to create a new Indicator name for this version, like "ADXVMA SR Only" for instance, to keep the original indicator intact:

 
Code
                            
inputs:
    
Price (close),
    
length (14);
    
vars:
    
av (0),
    
lastav (0);
    
av ADXVMA(Pricelength);

if 
av av[1then lastav av;
Plot1(lastav"ADXVMA"); 
Here are some screen shots. You can see it just plots the last S/R line only.

[IMG]https://nexusfi.com/v/u5vkdp.png[/IMG]

[IMG]https://nexusfi.com/v/qk6t6g.png[/IMG]

Let me know if its useful.

Mike


Visit my NexusFi Trade Journal Reply With Quote
  #8 (permalink)
 thatguy 
New Brunswick, NJ
 
Experience: Intermediate
Platform: N/A
Trading: N/A
Posts: 133 since Jun 2009
Thanks Given: 46
Thanks Received: 157


syxforex View Post
Hi Mike,

I was trying to find out what exactly adxvma is, can't seem to google it, could you explain the calculation?

Thanks,


If you scroll up a few posts, Mike has posted the code in plain text.

Reply With Quote
  #9 (permalink)
 syxforex 
British Columbia
 
Experience: Advanced
Platform: NINJA
Broker: ZEN
Trading: Crude
Posts: 1,091 since May 2010

I see that. I don't know what the vars represent, ie, pdi... etc. I was looking for a description in English if anybody has one?


thatguy View Post
If you scroll up a few posts, Mike has posted the code in plain text.


Visit my NexusFi Trade Journal Reply With Quote
  #10 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,446 since Jun 2009
Thanks Given: 33,217
Thanks Received: 101,610


I believe in laymens terms it uses a VMA and ADX together to plot the MA. The MA is primarily based on the VMA of price but uses the ADX values to determine volatility, adjusting the VMA by the volatility.

As I am not the original author I can't say for sure, but that is what I see from glancing at the code.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:




Last Updated on October 29, 2014


© 2024 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 - Privacy Policy - Downloads - Top
no new posts