NexusFi: Find Your Edge


Home Menu

 





Return Custom Indicator value within a window of time?


Discussion in EasyLanguage Programming

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




 
Search this Thread

Return Custom Indicator value within a window of time?

  #1 (permalink)
SwingStockTrader
Palm Springs
 
Posts: 5 since Jun 2014
Thanks Given: 2
Thanks Received: 0

HI: First post, thanks for the assistance ;√)

The following simple "for" loop, looks back X number of days and indicates if the Volume
has exceeded the moving avg of volume by at least 4 Std Deveations.

{VOLUME> SDV CHECK WITHIN X# OF DAYS}
FOR WXD2 = 0 TO WXDST BEGIN
If VOLUME (WXD2) > SDVOL2
THEN VOLDCOUNT = WXD2;
End ;

WXD2 = WITHIN X DAYS, WXDST = IMPUT OF NUMBER OF DAYS YOU WANT TO LOOKBACK.

That works just fine. I am encountering a problem when the indicator is custom and I want the same lookback ability as the reserved word Volume provides, i.e., Volume(#). Where number is my lookback days counter. Below I am using the same loop, but the trigger is now the number of long tails in the previous X number of days.

The EasyLanguage compile error that I am receiving is: "Cannot implicitly convert Numerical to True False" I have tried to assign TSCOUNT to a new variable like "Value1" as suggested in the error code directory but still get the same error code.

{CHECK TSCOUNT > 9 WITHIN X# OF DAYS}
FOR WXD1 = 0 TO WXDST BEGIN
IF TSCOUNT(WXD1) > 9
THEN TCDCOUNT = WXD1:
End ;

Grateful for any help or sugestions. More than glad to share any code relating to this issue.

Thanks

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Exit Strategy
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
How to apply profiles
Traders Hideout
MC PL editor upgrade
MultiCharts
NexusFi Journal Challenge - May 2024
Feedback and Announcements
 
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
34 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
24 thanks
GFIs1 1 DAX trade per day journal
22 thanks
  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,435 since Apr 2013
Thanks Given: 482
Thanks Received: 1,628


SwingStockTrader,

it's hard to say without knowing the full code. It could simply be that a variable is declared as boolean and now you try to store a numerical value with it. Besides that referencing previous bar values should be done with square brackets and not round brackets. At least the current Tradestation versions won't compile
 
Code
Value1 = Volume(1);
where Volume is a reserved word. Which platform are you using?

Regards,
ABCTG

Follow me on Twitter Reply With Quote
Thanked by:
  #4 (permalink)
SwingStockTrader
Palm Springs
 
Posts: 5 since Jun 2014
Thanks Given: 2
Thanks Received: 0

Thanks, the problem was the omission of the square brackets. I assumed because I was using a variable to determine the days back that it should be () not []. Don't know why I made that assumption, but changing them eliminated the problem.

Michael

Reply With Quote




Last Updated on July 12, 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