NexusFi: Find Your Edge


Home Menu

 





question regarding order generation and onbarclose


Discussion in EasyLanguage Programming

Updated
    1. trending_up 1,692 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

  #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?
How to apply profiles
Traders Hideout
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
PowerLanguage & EasyLanguage. How to get the platfor …
EasyLanguage Programming
Exit Strategy
NinjaTrader
MC PL editor upgrade
MultiCharts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Just another trading journal: PA, Wyckoff & Trends
25 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
21 thanks
GFIs1 1 DAX trade per day journal
16 thanks
  #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
  #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