NexusFi: Find Your Edge


Home Menu

 





Semicolon error in the formula after "CurrentBar"


Discussion in EasyLanguage Programming

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




 
Search this Thread
  #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?
The June 15 Resolution Trap: Irans Agreed Text Still Pri …
Prediction Markets & Event Contracts
MyForexFunds Begins Returning Frozen Funds After CFTC Ca …
Funded Trading Evaluation Firms
Rubios Good News Within Hours and the 30-Day Math: Why H …
Prediction Markets & Event Contracts
Sundays Verdict: Lebanon Locked at 99.85% as Iran June 7 …
Prediction Markets & Event Contracts
Trump Truth Social Fires Hormuz From 10% to 59% -- Arsen …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Big Mike in Ecuador
197 thanks
Sober Journey With S&P
27 thanks
30 Sessions
20 thanks
BERN ALGOS algo trading journal
8 thanks
Volume Indicators
8 thanks
  #3 (permalink)
 kevinkdog   is a Vendor
 
Posts: 3,737 since Jul 2012
Thanks Given: 1,917
Thanks Received: 7,476



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 X 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


© 2026 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 - Downloads - Top
no new posts