NexusFi: Find Your Edge


Home Menu

 





question regarding order generation and onbarclose


Discussion in EasyLanguage Programming

Updated
    1. trending_up 1,677 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread

question regarding order generation and onbarclose

(login for full post details)
  #1 (permalink)
 KhaosTrader 
San Jose
 
Experience: Intermediate
Platform: NinjaTrader, Esignal
Trading: Stocks
Posts: 107 since Jan 2012
Thanks Given: 40
Thanks Received: 21

My strategy requires a qualification bar, which can be qualified intrabar, but it MUST be qualified on bar close for an order to be submitted on the next bar.

My approach was to use if barstatus(1)=2 on the qualification bar, and then issue a buy order to go Long.

Her is some pseudocode:

 
Code
if barstatus(1)=2 and (qualification logic) = true then setbuyflag = true;

if setbuyflag=true then Buy ("Long") 2 Contracts next Bar at 
    vTrade_TriggerEntryPrice stop (vTrade_TriggerEntryPrice +3 * vTickSize)  limit;
The problem is that the "next bar" makes it skip a bar. So if setupbar is bar number 1, then I want to be able to enter the market if price reaches a certain point in bar number 2. However, the order only seems to be firing 2 bars after the setup bar, not the next bar.

So what do I do to make this work? Any ideas?

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ISO Equity Curve Indicator
NinjaTrader
Volume profile TradeStation
EasyLanguage Programming
Trader Dale [email protected] or Scammer Dale
Trading Reviews and Vendors
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Request for MACD with option to use different MAs for fa …
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
GFIs1 1 DAX trade per day journal
28 thanks
Supertradersams Thread Journal on NQ/MNQ
26 thanks
Tao te Trade: way of the WLD
24 thanks
Just another trading journal: PA, Wyckoff & Trends
12 thanks
1% Risk Journal
11 thanks

(login for full post details)
  #3 (permalink)
Bimi
London
 
Posts: 118 since Mar 2010
Thanks Given: 42
Thanks Received: 58



KhaosTrader View Post
My strategy requires a qualification bar, which can be qualified intrabar, but it MUST be qualified on bar close for an order to be submitted on the next bar.

My approach was to use if barstatus(1)=2 on the qualification bar, and then issue a buy order to go Long.

Her is some pseudocode:

 
Code
if barstatus(1)=2 and (qualification logic) = true then setbuyflag = true;

if setbuyflag=true then Buy ("Long") 2 Contracts next Bar at 
    vTrade_TriggerEntryPrice stop (vTrade_TriggerEntryPrice +3 * vTickSize)  limit;
The problem is that the "next bar" makes it skip a bar. So if setupbar is bar number 1, then I want to be able to enter the market if price reaches a certain point in bar number 2. However, the order only seems to be firing 2 bars after the setup bar, not the next bar.

So what do I do to make this work? Any ideas?

You are complicating things.
Keep your logic simple. Do only things that are tried and proven. The more tricks you try to pull, the more trouble you will get into down the road. It is the things that you don't know that can hurt you. I might sound negative and discouraging, but I am talking reality: I have seen enough naive people wasting years of their lives trying to do something that they could have do without.

Reply With Quote
(login for full post details)
  #4 (permalink)
 KhaosTrader 
San Jose
 
Experience: Intermediate
Platform: NinjaTrader, Esignal
Trading: Stocks
Posts: 107 since Jan 2012
Thanks Given: 40
Thanks Received: 21

logic is rather simple.

Once a qualified setup bar is found (determined on close), i then use some of the information from the closed bar to determine entry price for next bar.

Started this thread Reply With Quote





Last Updated on October 27, 2012


© 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