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 3,226 views
    2. thumb_up 0 thanks given
    3. group 4 followers
    1. forum 9 posts
    2. attach_file 0 attachments




 
Search this Thread

EasyLanguage Buy within a bar

  #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?
NexusFi Journal Challenge - May 2024
Feedback and Announcements
Better Renko Gaps
The Elite Circle
ZombieSqueeze
Platforms and Indicators
Trade idea based off three indicators.
Traders Hideout
MC PL editor upgrade
MultiCharts
 
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,435 since Apr 2013
Thanks Given: 482
Thanks Received: 1,628

StockT8er,

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

Regards,

ABCTG

Follow me on Twitter 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: MC, TS, Python, Rust
Broker: IB, IQFeed, TS, Kraken
Trading: ES, NQ, RTY, YM, CL, RB, 6E
Frequency: Several times daily
Duration: Seconds
Posts: 144 since Oct 2009
Thanks Given: 902
Thanks Received: 143


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 Twitter 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


© 2024 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 - Privacy Policy - Downloads - Top
no new posts