Before I go delving into the way to do this, I want to know if this is possible. Sometimes on lower time frames it can be quite frantic to calculate the trade position size to adhere to your money management rules. So I want to be able to calculate the pip size of a price bar, and from that, along with the current exchange rates, calculate my position size. Then print the figure out on the chart whenever the strategy throws up its signal?
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
Post position size on charts
Collapse
X
-
Post position size on charts
Hi
Before I go delving into the way to do this, I want to know if this is possible. Sometimes on lower time frames it can be quite frantic to calculate the trade position size to adhere to your money management rules. So I want to be able to calculate the pip size of a price bar, and from that, along with the current exchange rates, calculate my position size. Then print the figure out on the chart whenever the strategy throws up its signal?Tags: None
-
Originally posted by NinjaTrader_Josh View PostYes you can do that. To print values onto the chart you could use DrawText() or DrawTextFixed().
So now I need to make a calculation based on the high, low and close value of the last bar, and then pass the result into the Drawtext function. How would I go about this?
Comment
-
For example this snippet draws the High / Low range of the last completed bar in the upper right corner of the chart -
Code:protected override void OnBarUpdate() { double myRange = High[0] - Low[0]; DrawTextFixed("myRangeText", myRange.ToString(), TextPosition.TopRight); }
BertrandNinjaTrader Customer Service
Comment
-
Thanks Bertrand
I've now set my three variables (myEntry, myStop, myPos). Is it possible to include all three of these in the string with a carriage break between them, so I have a list consisting of entry price, stop loss, position size printed on the chart?
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by llanqui, Today, 11:10 AM
|
0 responses
4 views
0 likes
|
Last Post
by llanqui
Today, 11:10 AM
|
||
Started by llanqui, Today, 10:29 AM
|
0 responses
5 views
0 likes
|
Last Post
by llanqui
Today, 10:29 AM
|
||
Started by llanqui, Today, 08:32 AM
|
1 response
11 views
0 likes
|
Last Post
by llanqui
Today, 08:50 AM
|
||
Started by lollers, Yesterday, 03:26 AM
|
1 response
53 views
0 likes
|
Last Post
by lollers
Today, 07:20 AM
|
||
Started by Salahinho99, 05-05-2024, 04:13 AM
|
7 responses
63 views
0 likes
|
Last Post
by Salahinho99
Today, 06:45 AM
|
Comment