NexusFi: Find Your Edge


Home Menu

 





EasyLanguage Buy within a bar


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one StockT8er with 7 posts (0 thanks)
    2. looks_two ABCTG with 1 posts (0 thanks)
    3. looks_3 Fu510n with 1 posts (0 thanks)
    4. looks_4 Midline with 1 posts (0 thanks)
    1. trending_up 5,992 views
    2. thumb_up 0 thanks given
    3. group 4 followers
    1. forum 9 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 StockT8er 
ROY, Utah
 
Experience: Intermediate
Platform: TradeStation
Posts: 81 since Apr 2020
Thanks Given: 11
Thanks Received: 6

I've tried everything I can think of. And It just don't make since that you can not place a order at the time the condition is met. WHY do programmers make it so you have to wait til Close of the current bar or Open of next bar, by that time you have lost
Anyone know how to solve this?


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Kalshi Sets $4.13B All-Time Weekly Record as Polymarket …
Prediction Markets & Event Contracts
Thursday May 28: GDP + Core PCE + Jobless Claims All at …
Traders Hideout
Hormuz Normalization Collapses to 19.5% -- Iran Regime F …
Prediction Markets & Event Contracts
Peace Deal Forward Curve: May 22%, June 51%, December 81 …
Prediction Markets & Event Contracts
Iran Peace Expired NO: Ceasefire on Life Support, OPEC a …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
15 thanks
Darmok and Jalad at Tanagra
3 thanks
Big Mike in Ecuador
1 thanks
30 Sessions
1 thanks
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,643

StockT8er,

welcome to NexusFi. Take a look at intrabar order generation which allows you to issue orders during a bar with EasyLanguage.

Regards,

ABCTG


Follow me on X Reply With Quote
  #3 (permalink)
 StockT8er 
ROY, Utah
 
Experience: Intermediate
Platform: TradeStation
Posts: 81 since Apr 2020
Thanks Given: 11
Thanks Received: 6


It still waits to buy at open of next bar, It will not buy with in current bar


Started this thread Reply With Quote
  #4 (permalink)
 StockT8er 
ROY, Utah
 
Experience: Intermediate
Platform: TradeStation
Posts: 81 since Apr 2020
Thanks Given: 11
Thanks Received: 6

It still waits to buy at open of next bar, It will not buy with in current bar


Started this thread Reply With Quote
  #5 (permalink)
Midline
Basking Ridge
 
Posts: 7 since Mar 2020
Thanks Given: 2
Thanks Received: 9

According to the documentation linked below you should be able to generate an order on the next tick if your condition holds true.

https://www.multicharts.com/trading-software/index.php/IntraBarOrderGeneration

I'm with you though; I think Easylanguage sucks big time! It makes you jump through hoops to do things that should be simple to do. I don't understand why that is so.


Reply With Quote
  #6 (permalink)
 StockT8er 
ROY, Utah
 
Experience: Intermediate
Platform: TradeStation
Posts: 81 since Apr 2020
Thanks Given: 11
Thanks Received: 6

Well with EasyLanguage it does not work. Is there another platform that it will, and does that platform allow you to have a 5,10,15,30 second time frame


Started this thread Reply With Quote
  #7 (permalink)
 StockT8er 
ROY, Utah
 
Experience: Intermediate
Platform: TradeStation
Posts: 81 since Apr 2020
Thanks Given: 11
Thanks Received: 6

This is the script

[IntrabarOrderGeneration = True]

Variables:
TickSize (MinMove / PriceScale );

Value1 = 0;

If (BarStatus(1) = 2) and Close[0] > Open[0] Then begin
Value1 = 1;
end;

inputs:
LECondition( Close > Open ) [DisplayName = "LECondition", ToolTip =
"Long Entry Condition. Enter an EasyLanguage expression. When expression is true, the strategy will buy."];

if (BarStatus(1) = 2) and // only submit orders at the close of the bar
(MarketPosition = 0) and Value1 = 1 {inside bar} Then Begin

Buy ( !( "TLX" ) ) 10 Shares at next Bar CurrentBid or Higher;
end;


Started this thread Reply With Quote
  #8 (permalink)
 
Fu510n's Avatar
 Fu510n 
Suffield, CT
 
Experience: Advanced
Platform: TS, MC, MW, Python, Rust
Broker: TS, IB, IQFeed, Kraken
Trading: NQ, ES, CL, RTY
Frequency: Several times daily
Duration: Seconds
Posts: 165 since Oct 2009
Thanks Given: 943
Thanks Received: 166


StockT8er View Post
This is the script

[IntrabarOrderGeneration = True]

Variables:
TickSize (MinMove / PriceScale );

Value1 = 0;

If (BarStatus(1) = 2) and Close[0] > Open[0] Then begin
Value1 = 1;
end;

inputs:
LECondition( Close > Open ) [DisplayName = "LECondition", ToolTip =
"Long Entry Condition. Enter an EasyLanguage expression. When expression is true, the strategy will buy."];

if (BarStatus(1) = 2) and // only submit orders at the close of the bar
(MarketPosition = 0) and Value1 = 1 {inside bar} Then Begin

Buy ( !( "TLX" ) ) 10 Shares at next Bar CurrentBid or Higher;
end;

Computers generally do what they're told - in this case with IntrabarOrderGeneration enabled, "next bar" is actually "next tick". You're checking for the end of the current bar with "BarStatus(1) = 2" which is fine though my guess is that it's simply waiting to enter whenever the next tick kicks in at the start of the NEXT bar (which could be "immediately" or a LONG time depending on how volatile the security is at the moment).

My .02 - what bar type are you using? (time-based, range, tick, Renko, etc.)


Follow me on X Reply With Quote
  #9 (permalink)
 StockT8er 
ROY, Utah
 
Experience: Intermediate
Platform: TradeStation
Posts: 81 since Apr 2020
Thanks Given: 11
Thanks Received: 6

10 Second, or 15 /second, 30 Second

Should I go to

10 Tick, 20 Tick etc.?


Started this thread Reply With Quote
  #10 (permalink)
 StockT8er 
ROY, Utah
 
Experience: Intermediate
Platform: TradeStation
Posts: 81 since Apr 2020
Thanks Given: 11
Thanks Received: 6


My ultimate goal would be to Buy as soon as a Bar turned Green and Sell as soon as a Bar turned Red
The Software is able to do it, why can we not tie into the software's logic?
When I watch a chart. Depending on the time of a bar, most bars stay either Green or Red, from beginning to end of bar.


Started this thread Reply With Quote




Last Updated on April 25, 2020


© 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