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,905 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?
Iran Lebanon Problem Kills Switzerland Talks, Brent at $ …
Prediction Markets & Event Contracts
I Have a Thing Called Iran -- Trump Stays in DC as Airsp …
Prediction Markets & Event Contracts
Iran Airspace Contract Surges to 33.5% as Project Freedo …
Prediction Markets & Event Contracts
Second Night of US Strikes Crushes Iran June 15 to 3.6% …
Prediction Markets & Event Contracts
Bookmap Global Plus Lifetime + Lifetime Addons For Sale
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
6 thanks
Darmok and Jalad at Tanagra
1 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,175 since Jan 2013
Thanks Given: 58,011
Thanks Received: 26,424


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,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,643


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,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,643

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