NexusFi: Find Your Edge


Home Menu

 





Bar Delay Between Entries


Discussion in MultiCharts

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




 
Search this Thread
  #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?
Saylors 41-Month HODL Breaks: Strategy Sells 32 BTC as $ …
Prediction Markets & Event Contracts
Trump Truth Social Fires Hormuz From 10% to 59% -- Arsen …
Prediction Markets & Event Contracts
April CPI Preview: +3.7% YoY Expected at 8:30 AM ET -- C …
Traders Hideout
Khamenei Vetoes Uranium Transfer as Peace Odds Surge to …
Prediction Markets & Event Contracts
Penalties in Budapest, Peace Deadline in Tehran: Arsenal …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
The Pivot Point 113.6³ — Navigating the Prediction of …
26 thanks
Sober Journey With S&P
17 thanks
The Confluence Meter: A Multi-Layered Signal Framework B …
11 thanks
NT8 color choices
10 thanks
Volume Indicators
7 thanks
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,447 since Apr 2013
Thanks Given: 493
Thanks Received: 1,639

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 X 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: 691


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


© 2026 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 - Downloads - Top
no new posts