NexusFi: Find Your Edge


Home Menu

 





Bar Delay Between Entries


Discussion in MultiCharts

Updated
      Top Posters
    1. looks_one Jura with 1 posts (1 thanks)
    2. looks_two ABCTG with 1 posts (0 thanks)
    3. looks_3 quantarb with 1 posts (0 thanks)
    4. looks_4 grew with 1 posts (0 thanks)
    1. trending_up 2,029 views
    2. thumb_up 1 thanks given
    3. group 3 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread

Bar Delay Between Entries

  #1 (permalink)
 quantarb 
Wayne, NJ USA
 
Experience: Intermediate
Platform: Multicharts, Deltix DCS
Broker: Interactive Brokers/IQ Feed
Trading: ETF Options
Posts: 41 since Oct 2012
Thanks Given: 7
Thanks Received: 38

Hello,

I’m trying to find a way to have at least a certain number of bars between each entry. For example, I want there be at least six bars between each entry. After another new entry, the strategy must wait at least six bars before it is allowed to add to the position again.

I’m unable to use BarsSinceEntry(0) since it refers to the first entry of the current open position. I tried to create my own function BarsSinceLastEntry to retrieve the information I need.

 
Code
                            
If MarketPosition <> and BarSinceLastEntry >= 6 then     

Begin 
Buy more contracts at market
;
End
However, my current code isn’t working properly. When I insert it the strategy will stop adding to existing positions. Below is my own code for my own function BarsSinceLastEntry. I plotted it as an indicator and the functions appears to be working as intented. I’m not sure where I went wrong. Any ideas or suggestions would be greatly appreciated.

 
Code
                            
variablesvar0), var1)  ;


var0 CurrentShares


if 
var0 var0[1] or var0 0 then 
    begin 
    var1 
0;
    
end
    
//There must be a new entry - long or short  if CurrentShares increases.  This resets the bar count.  

if var0 var0[1] and var0 >= 1 then 
    begin 
    var1 
var1 1;
    
end

//If there is an open position, and the CurrentShares remains the same, add one to the bar count.  
    
var1 BarsSinceLastEntry

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
REcommedations for programming help
Sierra Chart
Better Renko Gaps
The Elite Circle
Trade idea based off three indicators.
Traders Hideout
Exit Strategy
NinjaTrader
 
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
17 thanks
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,434 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627

You might want to take a look into the reserved words PosTradeExitBar and PosTradeEntryBar. They make it possible to receive the specific entry and exit bar even with multi-leg positions.

Another approach would be to monitor a change in your market position or number of trades and save the bar number at this moment. Then you can block new trade entries as long as the new bar number < saved bar number + X.

Regards,
ABCTG

Follow me on Twitter Reply With Quote
  #3 (permalink)
 grew 
Los Angeles CA
 
Experience: Advanced
Platform: IB, MultiCharts
Trading: ES
Posts: 5 since Jan 2014
Thanks Given: 1
Thanks Received: 0


I am having the same issue. Eagerly awaiting more info

Reply With Quote
  #4 (permalink)
 
Jura's Avatar
 Jura   is a Vendor
 
Posts: 775 since Apr 2010
Thanks Given: 2,352
Thanks Received: 690


grew View Post
I am having the same issue. Eagerly awaiting more info

What is "the same issue"? QuantArb talks about two things that aren't necessarily related: 'bar delay between entries and 'code stops adding to new positions'. Please be more specific if you want help.

Reply With Quote
Thanked by:




Last Updated on August 9, 2015


© 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