NexusFi: Find Your Edge


Home Menu

 





Buy within a number of bars after entry signal (EL)?


Discussion in EasyLanguage Programming

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




 
Search this Thread
  #1 (permalink)
LeonTaiwan
Taichung Taiwan
 
Posts: 3 since Mar 2021
Thanks Given: 1
Thanks Received: 1

Howdy

I have searched the forum and couldn't find an answer. I would like to know if it is possible to buy within a certain number of bars after your entry signal? For example...I would like to buy after my signal within the next 4 bars after the signal, if not cancel the order. This is for Easylanguage on Tradestation.

Thanks you in advance


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Prop Firm Tracked Payouts Hit $115M in Q1 but Growth Fla …
Funded Trading Evaluation Firms
Day 97: Israel-Lebanon Ceasefire Struck Overnight -- WTI …
Traders Hideout
CFTC Opens First COT Report Review in 20 Years -- Asks W …
Traders Hideout
Trump Lands in Beijing on CPI Day: Iran Peace Expires To …
Prediction Markets & Event Contracts
Orban Crashes to 21pct on Record Turnout -- McIlroy Drop …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
21 thanks
2026 Jlab journal
10 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Lady Vols Primer: Trading Volatility Journal
6 thanks
2026 Fire Horse
5 thanks
  #2 (permalink)
 
bobwest's Avatar
 bobwest 
Western Florida
Site Moderator
 
Experience: Advanced
Platform: Sierra Chart
Trading: ES, YM
Frequency: Several times daily
Duration: Minutes
Posts: 8,174 since Jan 2013
Thanks Given: 57,989
Thanks Received: 26,406


LeonTaiwan View Post
Howdy

I have searched the forum and couldn't find an answer. I would like to know if it is possible to buy within a certain number of bars after your entry signal? For example...I would like to buy after my signal within the next 4 bars after the signal, if not cancel the order. This is for Easylanguage on Tradestation.

Thanks you in advance

This sounds like a straightforward job of EL programming, if anyone is willing to give @LeonTaiwan a hand with it.

The question was transferred here from the "ask any question" thread, to give it more visibility.

Bob.


When one door closes, another opens.
-- Cervantes, Don Quixote
Reply With Quote
  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,447 since Apr 2013
Thanks Given: 493
Thanks Received: 1,639


LeonTaiwan,

welcome to NexusFi. If I understand your request correctly this sounds like storing the value of CurrentBar within a variable when your signal is detected might be what you are looking for. Then you can use this variable in checking how many bars ago your signal was present when you issue the order.

Orders will get cancelled automatically if you do not issue them again upon the next code calculation, which is exactly what you would be using your new variable for i.e. conditionally issuing the order when the signal is not too old only.

Regards,

ABCTG



LeonTaiwan View Post
Howdy

I have searched the forum and couldn't find an answer. I would like to know if it is possible to buy within a certain number of bars after your entry signal? For example...I would like to buy after my signal within the next 4 bars after the signal, if not cancel the order. This is for Easylanguage on Tradestation.

Thanks you in advance


Follow me on X Reply With Quote
Thanked by:
  #4 (permalink)
LeonTaiwan
Taichung Taiwan
 
Posts: 3 since Mar 2021
Thanks Given: 1
Thanks Received: 1

Thank you for the reply. Is there anywhere you can direct me regarding the code to store the value of Currentbar in a variable? I am not all that familiar with coding, although trying to learn


Reply With Quote
  #5 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,447 since Apr 2013
Thanks Given: 493
Thanks Received: 1,639

LeonTaiwan,

you might benefit from going over at least some of the basics (like declaring variables etc.). The following links should get you going:




Regards,

ABCTG



LeonTaiwan View Post
Thank you for the reply. Is there anywhere you can direct me regarding the code to store the value of Currentbar in a variable? I am not all that familiar with coding, although trying to learn


Follow me on X Reply With Quote
Thanked by:




Last Updated on July 4, 2022


© 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