Semicolon error in the formula after "CurrentBar" - futures io
futures io futures trading



Semicolon error in the formula after "CurrentBar"


Discussion in EasyLanguage Programming

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




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

Semicolon error in the formula after "CurrentBar"

(login for full post details)
  #1 (permalink)
Sydney, Australia
 
Experience: Intermediate
Platform: TradeStation
Trading: ES NQ CL GC
 
Posts: 2 since Oct 2017
Thanks: 2 given, 0 received

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)

Reply With Quote

 
Best Threads (Most Thanked)
in the last 7 days on futures io
The Small Exchange (www.smallexchange.com)
106 thanks
Big Mike in Ecuador
85 thanks
How did you learn to trade?
58 thanks
Whos afraid of the big bad Glitch
51 thanks
NinjaTrader buys TransAct Futures (Infinity Brokers), plans its own FCM
36 thanks
 
(login for full post details)
  #3 (permalink)
Legendary Market Wizard
Cleveland Ohio/United States
 
Experience: Advanced
Platform: Tradestation
Broker: Tradestation, DeCarley, others
Trading: futures
 
Posts: 2,917 since Jul 2012
Thanks: 1,535 given, 5,717 received



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
The following user says Thank You to kevinkdog for this post:
 
(login for full post details)
  #4 (permalink)
Sydney, Australia
 
Experience: Intermediate
Platform: TradeStation
Trading: ES NQ CL GC
 
Posts: 2 since Oct 2017
Thanks: 2 given, 0 received


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!

Reply With Quote


futures io Trading Community Platforms and Indicators EasyLanguage Programming > Semicolon error in the formula after "CurrentBar"


Last Updated on March 19, 2018


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Journal Challenge!

February
 

Battlestations!

March
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts