Way to Execute Something *Once,* Then Move On? - futures io
futures io



Way to Execute Something *Once,* Then Move On?


Discussion in EasyLanguage Programming

Updated
    1. trending_up 1,653 views
    2. thumb_up 4 thanks given
    3. group 2 followers
    1. forum 12 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
 

Way to Execute Something *Once,* Then Move On?

(login for full post details)
  #11 (permalink)
djvie11
Chicago, IL
 
 
Posts: 52 since Jul 2013
Thanks: 29 given, 1 received

Thank you very much for that idea, Chris! And for those interested, info about the "Once" Reserved word is on page 861 of this PDF:

https://uploads.tradestation.com/uploads/EasyLanguage-Functions-and-Reserved-Words-Reference.pdf



ABCTG View Post
If you actually only want to do it once and not once per trade, you could also look at the reserved word "once" or simply initialize your variable with the reset value. However from your code it looks more like you are trying to track the high while you are in a position, which will likely mean you want to reset the variable at the beginning of every trade.

Regards,

ABCTG


Reply With Quote

Can you help answer these questions
from other members on futures io?
NinjaTrader Market Replay downloads now in 100Mb chunks
Feedback and Announcements
MacdBB V402 NT804 + gradient + pullback not working on N …
NinjaTrader
uptick/downtick vs bid/ask
NinjaTrader
Tradestation order types - help
TradeStation
Bars repainting
ThinkOrSwim
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Question about intraday margins
61 thanks
How quickly do algos go bad?
46 thanks
ZombiePack3 Indicators
19 thanks
Webinar: Building a System for Trading Psychology w/Jare …
18 thanks
Want your NinjaTrader indicator created, free?
14 thanks
 
(login for full post details)
  #12 (permalink)
djvie11
Chicago, IL
 
 
Posts: 52 since Jul 2013
Thanks: 29 given, 1 received

I suppose the downside of this is that it will literally only run the script once. I verified this via the Print function.

I was hoping that when MarketPosition switched back from 0/1/-1 it would "reset" the once and run it again. I'll report back if I figure out a fix (I.e went the MarketPosition went from 0 to 1; Run script once. Then went it went back to 0 again it would essentially reset the once command so when it went from 0 to 1 again (or -1) it would run again.

 
Code
IF MarketPosition = 1  THEN ONCE Reset; 
  
IF MarketPosition = -1 THEN ONCE Reset ;

Reply With Quote
 
(login for full post details)
  #13 (permalink)
 ABCTG   is a Vendor
 
 
Posts: 2,262 since Apr 2013
Thanks: 417 given, 1,508 received


Hi Brandon,

yes, that's why I suggested it might not be suitable for your approach as you can not reset the once.

Did you test the code snippet I posted using print statements? What results did you get?

Regards,

ABCTG


djvie11 View Post
I suppose the downside of this is that it will literally only run the script once. I verified this via the Print function.

I was hoping that when MarketPosition switched back from 0/1/-1 it would "reset" the once and run it again. I'll report back if I figure out a fix (I.e went the MarketPosition went from 0 to 1; Run script once. Then went it went back to 0 again it would essentially reset the once command so when it went from 0 to 1 again (or -1) it would run again.

 
Code
IF MarketPosition = 1  THEN ONCE Reset; 
  
IF MarketPosition = -1 THEN ONCE Reset ;


Follow me on Twitter Reply With Quote


futures io Trading Community Platforms and Indicators EasyLanguage Programming > Way to Execute Something *Once,* Then Move On?


Last Updated on August 3, 2018


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing

A Transparent Glimpse Into a Prop Traders Life w/Chris Gray @ Earn2Trade

Elite only
 

Our 12-year anniversary w/ $$,$$$ prizes (check soon)

August
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada), 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