NexusFi: Find Your Edge


Home Menu

 





first tick of bar


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one cbritton with 2 posts (0 thanks)
    2. looks_two mboxwave with 2 posts (0 thanks)
    3. looks_3 Big Mike with 2 posts (1 thanks)
    4. looks_4 odmassion with 2 posts (0 thanks)
    1. trending_up 5,104 views
    2. thumb_up 1 thanks given
    3. group 4 followers
    1. forum 5 posts
    2. attach_file 0 attachments




 
Search this Thread

first tick of bar

  #1 (permalink)
 
cbritton's Avatar
 cbritton 
Atlanta, Georgia
 
Experience: Intermediate
Platform: NT
Broker: DDT
Trading: ZN, ZB
Posts: 230 since Mar 2010
Thanks Given: 152
Thanks Received: 256

Does easy language, more specifically, TradeStation, have a "first tick of bar" type of construct like NT? I'm trying to find a way to initialize a value in an indicator when a new bar is opened, but, obviously, not update that value again on intra bar updates.

Thanks,
-C

“Strategy without tactics is the slowest route to victory. Tactics without strategy is the noise before defeat.” - Sun Tzu
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Cheap historycal L1 data for stocks
Stocks and ETFs
REcommedations for programming help
Sierra Chart
What broker to use for trading palladium futures
Commodities
Better Renko Gaps
The Elite Circle
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
  #2 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,463 since Jun 2009
Thanks Given: 33,236
Thanks Received: 101,661


cbritton View Post
Does easy language, more specifically, TradeStation, have a "first tick of bar" type of construct like NT? I'm trying to find a way to initialize a value in an indicator when a new bar is opened, but, obviously, not update that value again on intra bar updates.

Thanks,
-C

Something like this?

 
Code
                            
[IntrabarOrderGeneration True]


Var: 
IntrabarPersist Mp(0), IntrabarPersist MP_prev(0),IntrabarPersist TradesThisBar(0),IntrabarPersist FirstTickOfBar(False); 

MP MarketPosition;  

If 
MP <> MP_prev  then TradesThisBar TradesThisBar 1
If 
FirstTickOfBar then TradesThisBar 0

if 
BarStatus(1)=2 then Value1=Random(10);

if 
TradesThisBar and Mp<>and Value1 5 then Buy next bar Open;//Market;
if TradesThisBar and Mp<>-and Value1 5 then SellShort next bar Open;//Market;

if TradesThisBar and  Mp=and BarsSinceEntry 1 then Sell next bar at Market;
if 
TradesThisBar and  Mp=-and BarsSinceEntry 1 then BuyToCover next bar at Market;

FirstTickOfBar BarStatus(1) = 2

MP_prev MP
Untested code, found on MultiCharts forum.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #3 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,463 since Jun 2009
Thanks Given: 33,236
Thanks Received: 101,661


 
Thread Moved


Moved to TradeStation Programming



When creating a new thread, note which subforum you are in. Here is a short list of suggestions:

- Topic: Anything to do with an Elite indicator -> Subforum: The Elite Circle
- Topic: Looking for an existing indicator, or how-to use an indicator -> Subforum: (the platform)
- Topic: Programmer needing help with non-Elite indicator -> Subforum: (the platform) - Programming
- Topic: Want an indicator created/modified -> Reply to "Want indicator created free" in Elite Circle
- Topic: Vendors (trading rooms, commercial indicators) -> Subforum: Vendors/Product Reviews
- Topic: Discussion of Forex or Currency trading -> Subforum: Forex and Currency Trading
- Topic: Journals of your trading -> Subforum: Trading Journals or Elite Trading Journals
- Topic: General trading related discussions -> Subforum: Traders Hideout
- Topic: Discussion of a trading method -> Subforum: Traders Hideout
- Topic: Automated Trading -> Subforum: Elite Automated Trading

Last, any Elite Member may create more or less any of these topics in The Elite Circle at your own discretion (your support is appreciated).

This is just a short general list and doesn't cover everything. If you are unsure where to create your new thread, just create it in Traders Hideout and a moderator will move it if necessary.

-- Big Mike Trading



Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #4 (permalink)
 
cbritton's Avatar
 cbritton 
Atlanta, Georgia
 
Experience: Intermediate
Platform: NT
Broker: DDT
Trading: ZN, ZB
Posts: 230 since Mar 2010
Thanks Given: 152
Thanks Received: 256


Big Mike View Post
Something like this?

 
Code
                            
[IntrabarOrderGeneration True]

Var: 
IntrabarPersist Mp(0), IntrabarPersist MP_prev(0),IntrabarPersist TradesThisBar(0),IntrabarPersist FirstTickOfBar(False); 

MP MarketPosition;  

If 
MP <> MP_prev  then TradesThisBar TradesThisBar 1
If 
FirstTickOfBar then TradesThisBar 0

if 
BarStatus(1)=2 then Value1=Random(10);

if 
TradesThisBar and Mp<>and Value1 5 then Buy next bar Open;//Market;
if TradesThisBar and Mp<>-and Value1 5 then SellShort next bar Open;//Market;

if TradesThisBar and  Mp=and BarsSinceEntry 1 then Sell next bar at Market;
if 
TradesThisBar and  Mp=-and BarsSinceEntry 1 then BuyToCover next bar at Market;

FirstTickOfBar BarStatus(1) = 2

MP_prev MP
Untested code, found on MultiCharts forum.

Mike

I should be able to work with this. Thanks!

-C

“Strategy without tactics is the slowest route to victory. Tactics without strategy is the noise before defeat.” - Sun Tzu
Started this thread Reply With Quote
  #5 (permalink)
 odmassion 
new york United states
 
Experience: Intermediate
Platform: Ninja Trader
Trading: Emini Es
Posts: 117 since Aug 2016
Thanks Given: 18
Thanks Received: 11


Big Mike View Post
Something like this?

 
Code
                            
[IntrabarOrderGeneration True]


Var: 
IntrabarPersist Mp(0), IntrabarPersist MP_prev(0),IntrabarPersist TradesThisBar(0),IntrabarPersist FirstTickOfBar(False); 

MP MarketPosition;  

If 
MP <> MP_prev  then TradesThisBar TradesThisBar 1
If 
FirstTickOfBar then TradesThisBar 0

if 
BarStatus(1)=2 then Value1=Random(10);

if 
TradesThisBar and Mp<>and Value1 5 then Buy next bar Open;//Market;
if TradesThisBar and Mp<>-and Value1 5 then SellShort next bar Open;//Market;

if TradesThisBar and  Mp=and BarsSinceEntry 1 then Sell next bar at Market;
if 
TradesThisBar and  Mp=-and BarsSinceEntry 1 then BuyToCover next bar at Market;

FirstTickOfBar BarStatus(1) = 2

MP_prev MP
Untested code, found on MultiCharts forum.

Mike

Hi Mike, how to i do this first tick of bar on ninjatrader? i am trying to make an indicator trigger a trade on the first tick of that bar.
Thanks

Reply With Quote
  #6 (permalink)
 odmassion 
new york United states
 
Experience: Intermediate
Platform: Ninja Trader
Trading: Emini Es
Posts: 117 since Aug 2016
Thanks Given: 18
Thanks Received: 11



Thanks,

but is this a strategy? if yes, how do i incorporate it into my NT7?

thanks in advance.

Reply With Quote




Last Updated on December 6, 2017


© 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