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 Fu510n with 1 posts (0 thanks)
    3. looks_3 Midline with 1 posts (0 thanks)
    4. looks_4 ABCTG with 1 posts (0 thanks)
    1. trending_up 5,701 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?
June 15 Peace Odds Surge From 3.6% to 12.25% After Trump …
Prediction Markets & Event Contracts
Fabrication or Framework? Irans Denied MOU Explains the …
Prediction Markets & Event Contracts
Beijing Summit Closes: Xi Pledges Hormuz Help -- $1.14B …
Prediction Markets & Event Contracts
CFTC Approves First US Bitcoin Perpetual Futures -- Kals …
Traders Hideout
CFTC Opens First COT Report Review in 20 Years -- Asks W …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Big Mike in Ecuador
196 thanks
Sober Journey With S&P
27 thanks
30 Sessions
20 thanks
BERN ALGOS algo trading journal
8 thanks
Volume Indicators
8 thanks
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,642

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