Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
How to get Open value on new candle
Collapse
X
-
Hello kujista,
If the Strategy is using Calculate .OnEachTick, or .OnPriceChange, the indicators will also be using that Calculate setting.
If you want actions to only occur on the first tick of a bar in any called indicator, add to the condition for that action IsFirstTickOfBar.
-
i meant, when i add into strategy indicator e. g. trend(inputs[2]), it will calculate indicator value on each incoming tick of inputs[2].. so i have to use if isfirstickofbar in indicator to optimize performance?
Leave a comment:
-
Hello kujista,
When you mention "which indicator uses inside strategy", are you asking which indicators can be called from a strategy?
Pretty much any indicator with plots (or updated public properties) can be called from a strategy.
Leave a comment:
-
thank you for explanation so indicator is called on each incoming tick of dataseries, which indicator uses inside strategy?
Leave a comment:
-
Hello kujista,
The hosted indicators will use the same Calculate mode as the host strategy.
This is necessary and should not be changed.
In the indicator, you can also code for logic to occur only if IsFirstTickOfBar is true.
Leave a comment:
-
ok i see that i have to optimize strategy using isfirstickofbar.. to minimize consumption. i also want to minimize cpu load on calculatin indicators inside strategy how does it work? do the indicators in strategy calculate oneachtick and if so how can i force them to calculate onbarclose.. i am still thinking about performance i use multiframes and more indicators and i have to minimize cpu load. thanjs for the tips
Leave a comment:
-
Hello kujista,
If you are wanting values from an open bar, you would need to use Calculate .OnEachTick. In historical TickReplay must also be enabled.
Below are links to the help guide on Calculate, TickReplay, and how bar information is accessed.
Leave a comment:
-
I am trying to get open of newly opened candle on barsinprogress = 2, which i supposed is close of barsinprogress = 1, see the picture and price i get. It is close of recently closed candle and i need open of actual. I hope i do not have to switch to calculate.oneachtick. I see the isfirsttickofbar is useless when using onbarclose
- Likes 1
Leave a comment:
-
Hello kujista,
To confirm, you are wanting the Open of the most recently fully closed bar on another series?
What are you comparing to know that this is not the value you are getting?
When Calculate is OnBarClose, IsFirstTickOfBar will always be true because the script is not checking individual ticks of the bar.
Leave a comment:
-
I use Calculate.OnBarClose and try to get Open on IsFirstTickOfBar which should not do any bad.. should it?
Leave a comment:
-
How to get Open value on new candle
Hello,
on this screen http://prntscr.com/obr8hk I need to get value of openning candle on which I place long market order - price is 7775.00
I use multitimeframe strategy.
CurrentBars[0] - visible chart 2 minute
CurrentBars[1] - chart 2 minute
CurrentBars[2] -1 tick for very smooth trades handing
I duplicated data [0] to [1] - for testing on tick data and keeping behaviour.
Problem is when new candle opens -> i wait fort BarsInProgress = 2 a try to get Opens[2][0], also tried Closes[2][0] - and still get no value 7775 but close of previous candle 7774,5
Am i missing something?
Thanks for advices
P. KujalTags: None
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by DavidHP, Today, 07:56 AM
|
1 response
5 views
0 likes
|
Last Post Today, 08:16 AM | ||
Started by kujista, Today, 06:23 AM
|
3 responses
6 views
0 likes
|
Last Post
by kujista
Today, 08:15 AM
|
||
Started by Mindset, Yesterday, 02:04 AM
|
2 responses
17 views
0 likes
|
Last Post Today, 08:15 AM | ||
Started by f.saeidi, Today, 08:03 AM
|
1 response
5 views
0 likes
|
Last Post Today, 08:15 AM | ||
Started by samish18, 04-17-2024, 08:57 AM
|
15 responses
52 views
0 likes
|
Last Post Today, 08:13 AM |
Leave a comment: