NexusFi: Find Your Edge


Home Menu

 





CurrentBar help!


Discussion in NinjaTrader

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




 
Search this Thread
  #1 (permalink)
kidvic
Los Angeles, CA
 
Posts: 92 since Mar 2015
Thanks Given: 13
Thanks Received: 3

Is there anyway to make CurrentBar = something else?
So when calculate bar on close is set to true, the second to last bar (Close[1]) is CurrentBar right?
And when calculate on bar close is set to false, the Close[0] is CurrentBar right?

Now is there anyway to make CurrentBar = another bar? meaning I could effectively call Close[3] as CurrentBar.
Is this possible.

In other words, can I make an indicator disregard the the last x number of bars, and start calculating currentbar from x candle,
Effectively what I want to do is shift the logic from close[0] to be close[3] (meaning currentbar has shifted 3) and also everything that follows, so close[1] effectively means close[4] if I have candle logic.

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Brendt Skorupinsky
Trading Reviews and Vendors
What You Know vs How much you know about it
Traders Hideout
Radarscreen
TradeStation
How to plot a custom icon for crossover
NinjaTrader
Help re translation of ninjascript to EL
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Tao te Trade: way of the WLD
45 thanks
What is Markets Chat (markets.chat) real-time trading ro …
41 thanks
HumbleTraders next chapter
36 thanks
ApexTraderFunding.com experience and review
32 thanks
1 Minute Man
19 thanks
  #3 (permalink)
 
rleplae's Avatar
 rleplae 
Gits (Hooglede) Belgium
Legendary Market Wizard
 
Experience: Master
Platform: NinjaTrader, Proprietary,
Broker: Ninjabrokerage/IQfeed + Synthetic datafeed
Trading: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
Posts: 2,997 since Sep 2013
Thanks Given: 2,442
Thanks Received: 5,863


Currentbar is automatically set by the platform when a new bar is added to the series.

You need to create your own variable, which you can call 'offset'.
you then assign this variable with a positive or negative value, whatever you like the offset to be
and when you refer to a bar, you add/substract this from your index.

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #4 (permalink)
kidvic
Los Angeles, CA
 
Posts: 92 since Mar 2015
Thanks Given: 13
Thanks Received: 3


rleplae View Post
Currentbar is automatically set by the platform when a new bar is added to the series.

You need to create your own variable, which you can call 'offset'.
you then assign this variable with a positive or negative value, whatever you like the offset to be
and when you refer to a bar, you add/substract this from your index.


Sorry, I probably wasn't specific enough.

I understand you can do this, I'm currently trying to figure:
the MAX function will start looking for the Max value of a given period. High, 10)[0]
This is will start at High[0] and look 10 bars back for the highest high.
and the HighestBar will give me the bar integer that produced that High.
However, if I use the Max function with high, 10)[5]
It will start at High[5] and look 10 bars from that point.

Now, how do I get the bar integer for that?
HighestBar only starts indexing from the currentbar, which is [0]

I can easily attain the value from the HighestBar int.
So I eliminated using the MAX function, so changing the CurrentBar would be ideal,
and not have to use the MAX function.

Reply With Quote
  #5 (permalink)
 
rleplae's Avatar
 rleplae 
Gits (Hooglede) Belgium
Legendary Market Wizard
 
Experience: Master
Platform: NinjaTrader, Proprietary,
Broker: Ninjabrokerage/IQfeed + Synthetic datafeed
Trading: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
Posts: 2,997 since Sep 2013
Thanks Given: 2,442
Thanks Received: 5,863


kidvic View Post
Sorry, I probably wasn't specific enough.

I understand you can do this, I'm currently trying to figure:
the MAX function will start looking for the Max value of a given period. High, 10)[0]
This is will start at High[0] and look 10 bars back for the highest high.
and the HighestBar will give me the bar integer that produced that High.
However, if I use the Max function with high, 10)[5]
It will start at High[5] and look 10 bars from that point.

Now, how do I get the bar integer for that?
HighestBar only starts indexing from the currentbar, which is [0]

I can easily attain the value from the HighestBar int.
So I eliminated using the MAX function, so changing the CurrentBar would be ideal,
and not have to use the MAX function.


might be helpful to read:


Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #6 (permalink)
kidvic
Los Angeles, CA
 
Posts: 92 since Mar 2015
Thanks Given: 13
Thanks Received: 3


rleplae View Post
might be helpful to read:



Didn't help.Thanks

Reply With Quote




Last Updated on February 12, 2016


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