NexusFi: Find Your Edge


Home Menu

 





Current ADX value - help


Discussion in EasyLanguage Programming

Updated
    1. trending_up 1,512 views
    2. thumb_up 4 thanks given
    3. group 2 followers
    1. forum 9 posts
    2. attach_file 0 attachments




 
Search this Thread

Current ADX value - help

  #1 (permalink)
GustavMejlvang
Copenhagen, Denmark
 
Posts: 15 since May 2017
Thanks Given: 6
Thanks Received: 3

Hi Futures.IO

I have trouble with calling and using the current ADX value.

I want to use it as a trend filter in my strategy code, so:


//

Var:

trendADX(0);

trendADX=ADX(14);

condition1=.....and trendADX>x(25 for example).



//

But whatever I set x to, it doesn't affect my strategy,. The exact same orders are placed, so I'm wondering what I am doing wrong? Do I need to make a function like, current ADX or?

Thank you in advance!

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Better Renko Gaps
The Elite Circle
Trade idea based off three indicators.
Traders Hideout
How to apply profiles
Traders Hideout
ZombieSqueeze
Platforms and Indicators
 
  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,435 since Apr 2013
Thanks Given: 482
Thanks Received: 1,628


GustavMejlvang,

I could only guess without seeing the full code, but the first thing I'd check is what the value of trendADX is on each bar.
If this doesn't qualify for an entry, but the entry is taken anyway, the problem is somewhere else within your code.

Regards,

ABCTG

Follow me on Twitter Reply With Quote
Thanked by:
  #4 (permalink)
GustavMejlvang
Copenhagen, Denmark
 
Posts: 15 since May 2017
Thanks Given: 6
Thanks Received: 3


ABCTG View Post
GustavMejlvang,

I could only guess without seeing the full code, but the first thing I'd check is what the value of trendADX is on each bar.
If this doesn't qualify for an entry, but the entry is taken anyway, the problem is somewhere else within your code.

Regards,

ABCTG

I have a strategy that produces orders and works. EURUSD, 15min.

I have added in the condition1: .......ADX(14)>20;

This does affect the netprofit slightly, but it still produces orders when ADX is below 20 which is very weird. If I then change the value to ADX>50, then it also affects the net profit slightly, but number of trades is almost the same and this does not make any sense at it is quite rare that ADX is above 50 for my signals....

My question is therefore, is my value for ADX "wrong"?

Thanks in advance.

Reply With Quote
  #5 (permalink)
GustavMejlvang
Copenhagen, Denmark
 
Posts: 15 since May 2017
Thanks Given: 6
Thanks Received: 3


GustavMejlvang View Post
I have a strategy that produces orders and works. EURUSD, 15min.

I have added in the condition1: .......ADX(14)>20;

This does affect the netprofit slightly, but it still produces orders when ADX is below 20 which is very weird. If I then change the value to ADX>50, then it also affects the net profit slightly, but number of trades is almost the same and this does not make any sense at it is quite rare that ADX is above 50 for my signals....

My question is therefore, is my value for ADX "wrong"?

Thanks in advance.

Just tried to do: ADX(14)=5000000 and it still produces the exact same trades. It's very weird tbh

Reply With Quote
  #6 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,435 since Apr 2013
Thanks Given: 482
Thanks Received: 1,628

GustavMejlvang,

your code snippet appears to call the function correctly - under the condition that this is the original build in function of course.
I am afraid with your code snippet no one but you will be able to answer if "is my value for ADX "wrong"". You need to check the values on your end (either with prints or by making them available to an indicator using i_SetPlotValue for example).

However the problem is likely somewhere else in your code. But for anyone to be able to help you, you'd either have to post the full code or create a demo code that shows the same behavior.

Regards,

ABCTG

Follow me on Twitter Reply With Quote
Thanked by:
  #7 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,435 since Apr 2013
Thanks Given: 482
Thanks Received: 1,628

GustavMejlvang,

sounds even more like the ADX not being the issue here.

One thing I would suggest though is, not to call the functions directly within the conditions. Call it upfront, store the value in a variable and then use the variable in your checks. You can refer to the build in ADX indicator as an example.
Otherwise you risk that "Series functions can return incorrect results if called within conditional statements" (this quote is from the Tradestation wiki).

Regards,

ABCTG



GustavMejlvang View Post
Just tried to do: ADX(14)=5000000 and it still produces the exact same trades. It's very weird tbh


Follow me on Twitter Reply With Quote
Thanked by:
  #8 (permalink)
GustavMejlvang
Copenhagen, Denmark
 
Posts: 15 since May 2017
Thanks Given: 6
Thanks Received: 3


ABCTG View Post
GustavMejlvang,

sounds even more like the ADX not being the issue here.

One thing I would suggest though is, not to call the functions directly within the conditions. Call it upfront, store the value in a variable and then use the variable in your checks. You can refer to the build in ADX indicator as an example.
Otherwise you risk that "Series functions can return incorrect results if called within conditional statements" (this quote is from the Tradestation wiki).

Regards,

ABCTG

Thanks a lot I have got it to work now

Reply With Quote
Thanked by:
  #9 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,435 since Apr 2013
Thanks Given: 482
Thanks Received: 1,628

GustavMejlvang,

what was the problem and solution?

Regards,

ABCTG

Follow me on Twitter Reply With Quote
  #10 (permalink)
GustavMejlvang
Copenhagen, Denmark
 
Posts: 15 since May 2017
Thanks Given: 6
Thanks Received: 3



ABCTG View Post
GustavMejlvang,

what was the problem and solution?

Regards,

ABCTG

I just added another condition which only contained the ADX parameter and then it worked.

Thanks for your help

Reply With Quote




Last Updated on May 10, 2017


© 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