NexusFi: Find Your Edge


Home Menu

 





Semicolon error in the formula after "CurrentBar"


Discussion in EasyLanguage Programming

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




 
Search this Thread

Semicolon error in the formula after "CurrentBar"

  #1 (permalink)
 FollowTheMoney 
Sydney, Australia
 
Experience: Intermediate
Platform: TradeStation
Trading: ES NQ CL GC
Posts: 2 since Oct 2017
Thanks Given: 2
Thanks Received: 0

Hi guys, New to EL here so likely I am overlooking something simple.

I am trying to code a strategy that requires an indicator to cross a threshold line, then wait, and then take the exit as it crosses the threshold again. However, something is wrong with compiling - in Condition_4 formula, it assumes CurrentBar needs to end the argument - asks for ')' there, in another version it similarly it asks for semicolon.

Please let me know what am I missing. I used a similar example from TS help files, with the same problem.

Thank you.


 
Code
Condition_2 = ( IndicatorValue > ThresholdHigh );

if Condition_2 then
	begin
	 Condition_3 = true ; // record that condition 2 happened, keeps ther record even after conditon 2 becomes false
	 value_1 = CurrentBar ; // record at which bar condition 2 happened
	end ; 

Condition_4	= ( CurrentBar – value_1 ) > 2 ; // wait 2 bars or more after condition 2 (used to start looking for exit condition)

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
About a successful futures trader who didn´t know anyth …
Psychology and Money Management
ZombieSqueeze
Platforms and Indicators
Trade idea based off three indicators.
Traders Hideout
 
  #3 (permalink)
 kevinkdog   is a Vendor
 
Posts: 3,666 since Jul 2012
Thanks Given: 1,892
Thanks Received: 7,360



FollowTheMoney View Post
Hi guys, New to EL here so likely I am overlooking something simple.

I am trying to code a strategy that requires an indicator to cross a threshold line, then wait, and then take the exit as it crosses the threshold again. However, something is wrong with compiling - in Condition_4 formula, it assumes CurrentBar needs to end the argument - asks for ')' there, in another version it similarly it asks for semicolon.

Please let me know what am I missing. I used a similar example from TS help files, with the same problem.

Thank you.


 
Code
Condition_2 = ( IndicatorValue > ThresholdHigh );

if Condition_2 then
	begin
	 Condition_3 = true ; // record that condition 2 happened, keeps ther record even after conditon 2 becomes false
	 value_1 = CurrentBar ; // record at which bar condition 2 happened
	end ; 

Condition_4	= ( CurrentBar – value_1 ) > 2 ; // wait 2 bars or more after condition 2 (used to start looking for exit condition)



Try retyping the Condition_4 line from scratch. I think you might have an invalid character (like a tab character) in the code before the equal sign.

I retyped that line, and it verifies fine.

Follow me on Twitter Reply With Quote
Thanked by:
  #4 (permalink)
 FollowTheMoney 
Sydney, Australia
 
Experience: Intermediate
Platform: TradeStation
Trading: ES NQ CL GC
Posts: 2 since Oct 2017
Thanks Given: 2
Thanks Received: 0


kevinkdog View Post
Try retyping the Condition_4 line from scratch. I think you might have an invalid character (like a tab character) in the code before the equal sign.

I retyped that line, and it verifies fine.

Kevin, thanks for solving my not so fun mystery! Great tip!

Started this thread Reply With Quote




Last Updated on March 19, 2018


© 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