NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 06-22-2012, 04:33 PM   #1
Deogenes
Member
 
Join Date: Nov 2011
Location: Berlin, Germany
Posts: 46
Thanks: 8
Thanked 0 times in 0 posts
Default HMA - extend value (from the last Bar) to the current bar

Hello everyone,

as you can see in the Chart: I would like to move the value of HMA every time when a new bar opens.
With two bars, a value for the current bar.With three bars, a value for the current bar etc.

The goal is an Enter Long Stop Order for the price, reached before, which has not yet reached by the current bar.

But how can i prolong the value (of any MA), each time to the current bar (when it opens)?

Thank you for your support!
Attached Images
File Type: jpg FDAX 09-12 (10 Range) 22_06_2012 HMA.jpg (182.2 KB, 13 views)
Last edited by Deogenes; 06-22-2012 at 04:54 PM. Reason: HMA - extend value (from the last Bar) to the current bar
Deogenes is offline  
Reply With Quote
Old 06-23-2012, 06:45 AM   #2
koganam
Senior Member
 
Join Date: Feb 2008
Location: Durham, North Carolina, USA
Posts: 3,198
Thanks: 24
Thanked 1,224 times in 995 posts
Send a message via Skype™ to koganam
Default

Quote:
Originally Posted by Deogenes View Post
Hello everyone,

as you can see in the Chart: I would like to move the value of HMA every time when a new bar opens.
With two bars, a value for the current bar.With three bars, a value for the current bar etc.

The goal is an Enter Long Stop Order for the price, reached before, which has not yet reached by the current bar.

But how can i prolong the value (of any MA), each time to the current bar (when it opens)?

Thank you for your support!
Why not just displace the HMA one bar forward by using the indicator configuration dialog?
koganam is offline  
Reply With Quote
Old 06-23-2012, 08:57 AM   #3
Deogenes
Member
 
Join Date: Nov 2011
Location: Berlin, Germany
Posts: 46
Thanks: 8
Thanked 0 times in 0 posts
Default

[Why not just displace the HMA one bar forward by using the indicator configuration dialog?]

Hello koganam,

first of all, I've noticed that I twisted my code. Instead of: HMA > / (<) Close I wrote: Close > / < HMA so the results very different

Now it works fine, just because you make me thinking!

2.
Displacement is clear and known, but it's not what would be possible:if you look at the chart,
you can see many reasons why it would be useful the HMA points to extend.

So I think it's still very interesting. If you could program it really well, it would certainly be a fine thing. And I'm far away from it

But maybe someone share my idea with his skill: I would be happy!!!
Attached Images
File Type: jpg FDAX 09-12 (10 Range) 22_06_2012 2.jpg (170.3 KB, 6 views)
Deogenes is offline  
Reply With Quote
Old 06-23-2012, 10:28 AM   #4
koganam
Senior Member
 
Join Date: Feb 2008
Location: Durham, North Carolina, USA
Posts: 3,198
Thanks: 24
Thanked 1,224 times in 995 posts
Send a message via Skype™ to koganam
Default

Quote:
Originally Posted by Deogenes View Post
[Why not just displace the HMA one bar forward by using the indicator configuration dialog?]

Hello koganam,

first of all, I've noticed that I twisted my code. Instead of: HMA > / (<) Close I wrote: Close > / < HMA so the results very different

Now it works fine, just because you make me thinking!

2.
Displacement is clear and known, but it's not what would be possible:if you look at the chart,
you can see many reasons why it would be useful the HMA points to extend.

So I think it's still very interesting. If you could program it really well, it would certainly be a fine thing. And I'm far away from it

But maybe someone share my idea with his skill: I would be happy!!!
Hm. I see now that what you really mean is to draw a line form each HMA point until the line is cut buy price; the lines being drawn from the top plot when the HMA is pointing down, and from the bottom plot when the HMA is pointing up. That is an awful lot of lines. Are you really sure that you want to bog down your system with so many DrawObjects, especially if they are not being drawn on BarClose?
koganam is offline  
Reply With Quote
Old 06-23-2012, 01:37 PM   #5
Deogenes
Member
 
Join Date: Nov 2011
Location: Berlin, Germany
Posts: 46
Thanks: 8
Thanked 0 times in 0 posts
Default

Quote:
Are you really sure that you want to bog down your system with so many DrawObjects, especially if they are not being drawn on BarClose?
It should be such that a change of direction deletes the lines previously, because this is no longer needed.
The interesting thing - too - is that these lines would show Resistance and support very fast and optically god visible.
Also, count Bars would be easier.
Deogenes is offline  
Reply With Quote
Old 06-23-2012, 03:06 PM   #6
koganam
Senior Member
 
Join Date: Feb 2008
Location: Durham, North Carolina, USA
Posts: 3,198
Thanks: 24
Thanked 1,224 times in 995 posts
Send a message via Skype™ to koganam
Default

Quote:
Originally Posted by Deogenes View Post
It should be such that a change of direction deletes the lines previously, because this is no longer needed.
The interesting thing - too - is that these lines would show Resistance and support very fast and optically god visible.
Also, count Bars would be easier.
What about the lines that are never crossed? How long do they stay? We would be having lines on the chart from the PPT low in March 2009!
koganam is offline  
Reply With Quote
The following user says thank you to koganam for this post:
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Bar/Candle color change with HMA slope??? MiniDowTrader Charting 3 10-17-2012 09:00 AM
TT Demo Feed: Start to draw new bar 8 seconds after the current bar ended cw30000 Charting 3 03-18-2011 07:21 AM
if Target Profit reached on previous bar, dont trade current bar paschall Strategy Development 4 09-02-2009 10:34 PM
Current Bar Open Equals Previous Bar Close ramacan Charting 6 05-23-2009 11:07 AM
Does NT simulator place orders at the Close of current bar, or Open of next bar? tomace Strategy Development 1 03-02-2009 12:43 PM


All times are GMT -6. The time now is 06:21 AM.