Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
About Net change
Collapse
X
-
Hello ラリー,
I've translated this with translate.google.com as
Is there a solution for items showing up in net change and only showing 0.00% even though they have changed?
May I have you add the 'Last close' market analyzer column and take a new screenshot?Chelsea B.NinjaTrader Customer Service
-
Comment
-
Hello ラリー,
Please add the Last close market analyzer column.- Right-click the Market Analyzer
- Select Columns
- Select Last close
- Click add
- Click Ok
- Take a new screenshot
Regarding changing the time of when price change occurs, this would require custom coding a market analyzer script. Instead of the marketDataUpdate.Instrument.MarketData.LastClose.P rice, which comes directly from the data provider, you could code the script to load a data series, and then save the price at a specific time to a variable, and then calculate the net change from that variable. That would allow you to select a price at any time, instead of the session close.
Please let me know if you are interested in custom coding a market analyzer script to use the price from a selected time instead of the session close and would like further direction.Chelsea B.NinjaTrader Customer Service
Comment
-
Thank you for your reply.
Regarding changing the time of when price change occurs, this would require custom coding a market analyzer script. Instead of the marketDataUpdate.Instrument.MarketData.LastClose.P rice, which comes directly from the data provider, you could code the script to load a data series, and then save the price at a specific time to a variable, and then calculate the net change from that variable. That would allow you to select a price at any time, instead of the session close.
Please let me know if you are interested in custom coding a market analyzer script to use the price from a selected time instead of the session close and would like further direction.
I would like to do those with Net Change, is it possible?
Comment
-
Hello ラリー,
Please add the Last close market analyzer column and provide a screenshot.- Right-click the Market Analyzer
- Select Columns
- Select Last close
- Click add
- Click Ok
- Take a new screenshot
I would like to do those with Net Change, is it possible?
You can start by making a copy of the NetChange MarketAnalyzerColumn in the NinjaScript Editor.
Below is a link to a forum post with helpful resources on getting started with C# and NinjaScript.
https://ninjatrader.com/support/foru...040#post786040
To make a copy, open the script in the NinjaScript Editor, right-click the code, select Save As, type a new unique name, click OK
https://youtu.be/H7aDpWoWUQs?t=355&l...We0Nf&index=14
Set IsDataSeriesRequired.
https://ninjatrader.com/support/help...esrequired.htm
Add a private double variable in the scope of the class to hold the price.
In OnBarUpdate(), add a time condition to trigger an action at a specific time.
https://ninjatrader.com/support/help...to_limit_t.htm
For the action set the double variable to the Close[0].
Substitute this double variable in the logic in place of 'marketDataUpdate.Instrument.MarketData.LastClose. Price'.Chelsea B.NinjaTrader Customer Service
Comment
-
Thank you for your reply.
In OnBarUpdate(), add a time condition to trigger an action at a specific time.
https://ninjatrader.com/support/help...to_limit_t.htm
I also got an error output.
Comment
-
Hello ラリー,
Yes, the SampleTimeFilter_NT8 reference sample script can be imported. This is a working example that demonstrates how to create time conditions.
Use this as an educational example to learn about using DateTime objects in conditions.
To import a NinjaScript into NinjaTrader 8 do the following:- Download the script to your desktop, keep it in the compressed .zip file.
- From the Control Center window select Tools -> Import -> NinjaScript...
- Click the Desktop icon on the left to navigate to the desktop
- Select the downloaded .zip file -> then click Open
- NinjaTrader will then confirm if the import has been successful.
Below is a link to the help guide on importing.
https://ninjatrader.com/support/help...-us/import.htm
The code can be viewed in the NinjaScript Editor -> Strategies -> SampleTimeFilterChelsea B.NinjaTrader Customer Service
Comment
-
Comment
-
Thank you for your help.
If you have responded to my post, I would appreciate it if you could send it to me again, as I seem to be having some problems with my e-mails, notifications (not getting notifications, etc.) and other issues since the maintenance (NinjaTreder).
Comment
-
Hello ラリー,
and used the double variable instead of Price in the NetChange Script Editor
Below I am providing a link to a forum post with helpful resources on getting started with C# and NinjaScript.
https://ninjatrader.com/support/foru...040#post786040
A variable holds a value.
private double myVariable;
This variable has been declared with the type double and the name is myVariable.
myVariable = 5.1;
Now the variable has been assigned a double value of 5.1. Referring to the myVariable variable will return 5.1.
Print("myVariable has a value of " + myVariable);
In the output this would print 'myVariable has a value of 5.1'.
If wanted to use this variable in that line of code:
Code:case Cbi.PerformanceUnit.Percent: CurrentValue = (marketDataUpdate.Price - myVariable) / myVariable
Last edited by NinjaTrader_ChelseaB; 09-15-2022, 07:05 AM.Chelsea B.NinjaTrader Customer Service
Comment
-
I am contacting you to let you know of our progress.
I could not find the code description of the private double myVariable in either of the ninja scripts (Netchange, SampleTimeFilter), which one is it?
Also, in your post at #6, you said "To keep the price, add a private double variable to the scope of the class" and "In OnBarUpdate(), add a time condition that triggers the action at a specific time". Is it correct to add this to line 33 in the attached image?
Also, in OnBarUpdate(), to add a time condition that triggers the action at a specific time, is it correct to leave a space at line 57 of the SampleTimeFilter script and add it there?
Thank you in advance for your time.
Comment
-
Hello ラリー,
I was attempting to show you have to use a variable.
You will need to declare your own variable. It can have your custom name that you name it.
Assign the variable your calculated price.
Use the variable in place of the LastClose property being used now.
Yes, in your screenshot line 33 would be within the scope of the class and a good place to define variables.
No, line 57 is in the scope of the class and is not a place for logic.Last edited by NinjaTrader_ChelseaB; 09-21-2022, 12:42 PM.Chelsea B.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by pmachiraju, 11-01-2023, 04:46 AM
|
8 responses
147 views
0 likes
|
Last Post
by rehmans
Today, 06:44 PM
|
||
Started by mattbsea, Today, 05:44 PM
|
0 responses
5 views
0 likes
|
Last Post
by mattbsea
Today, 05:44 PM
|
||
Started by RideMe, 04-07-2024, 04:54 PM
|
6 responses
33 views
0 likes
|
Last Post
by RideMe
Today, 05:31 PM
|
||
Started by tkaboris, Today, 05:13 PM
|
0 responses
5 views
0 likes
|
Last Post
by tkaboris
Today, 05:13 PM
|
||
Started by GussJ, 03-04-2020, 03:11 PM
|
16 responses
3,282 views
0 likes
|
Last Post
by Leafcutter
Today, 04:14 PM
|
Comment