Thank you, Art.
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
Double arrow @ CrossAbv/Blw problem
Collapse
X
-
-
Hi Finn,
Here's the example...
if CrossBelow(Stochastics(PeriodD, PeriodK, Smooth), 80, 1) // any period...
{
if (anyMA < 0) // Draw arrows only if some MA direction is down
{
hh = MAX(High, 5)[0]; // get highest bar high
DrawArrowDown("DnArrow" + CurrentBar, true, 1, (hh+0.0008), Color.Red);
//prints lines for each bar, e.g. bunch of lines per arrow.
Print("Below 5 min hh = "+hh + " CurrentBar " + CurrentBar);
}
else
{
RemoveDrawObject("DnArrow" + CurrentBar);
}
}
The RemoveDrawObject() in else removes all the down arrows from the chart-no arrows on the chart at all.
Another issue I have is with Print() that partially works and in diff. thread. Although I'm using ...+ CurrentBar it prints lines for each bar, e.g. bunch of output lines per single arrow. Expected one cross/arrow - onle line of output. Please see attached - ready to use Stoch indicator with arrows and print()... The RemoveDrawObject() can be added for testing...
Thank you very much.
Regards, Art.Attached FilesLast edited by Art09; 11-16-2010, 08:44 PM.
Comment
-
Art09
Try this. I made some comments in the script.
It is a couple of things I dont understand. You are plotting the StochK, but use the StochD for your crosses, is this correct? You also have fifferent values for the OB / OS colors for the Stoch plot and the cross values. Is this correct?
btw, to avoid printing many lines in the output window, you will need to use if (FirstTickOfBar) statement.
FinnAttached FilesLast edited by finnbjurvoll; 11-17-2010, 04:13 AM.
Comment
-
-
-
-
Hi Finn and thank you again.
There must be smth in my orig program that does not work and causes arrow to disappear. I tried both scripts on diff. chart and it seemed worked fine-all the arrows are in place and I guess it will remove dbl arrows if any. I guess I will have to clean up my orig program and add your changes...
I thank you very much for your help. Please keep in touch - [email protected].
In the future is there a way to reach you (on some forum maybe) and ask for help?
For example, I noticed another problem and I do not know at this point if there is smth in my program or Ninja problem... Here's the problem - I looked at the chart yesterday and there was no cross, e.g. no arrow at some exact poitn of time I looked at. The Stoch was belw 80 and CrossBlw(....80...) would not work-below 75 would work, I tried. I looked at the same spot today and see my arrow and Stoch is abv 80 and crossing dn. I do not know if this is scaling problem or smth else. I see the same things happen every day - no signals in real time or stronger/weaker signals (I'm using AMP-Sim and in my orig program I color code the arrows for stronger/weaker signals). But I see crosses and arrows and/or stronger signals become weaker and the opposite after the session ends... I'm using 300 volume 6E chart for this. What do you think?
Thank you very much.
Regards, Art.Last edited by Art09; 11-17-2010, 11:36 AM.
Comment
-
-
Hi,
Struggling with dbl arrows when using cross abv/blw. Someone suggested using K[1] as follows:
if (K[0] <= 75 && K[0] >= 65)
{
if (CrossBelow(Stochastics(3, 10, 2).K, 75, 1))
Red arrow...
}
else if (K[0] <= 60 && K[0] >= 50)
{
if (CrossBelow(Stochastics(3, 10, 2).K, 60, 1) && (K[1] < 60 || K[1] > 70))
Orange arrow...
}
.....
But it still does not work and draws double arrows or no arrows at all where there used to be one.
My testing case is Euro 300 volume chart-Jan-06-11 @13:10. There is lower high on price and cross below 80-75 does not work.
The cross below 60 works, but only if I remove ... && (K[1] < 60 || K[1] > 70)) from the code. Otherwise no arrow displayed at all. But if I remove that line then double arrows for both crosses 75 and 60 will be displayed and same in many other places too.
Please help if you can.
Finn, if you are reading this maybe you'd be so kind to help too.
Thank you very much,
Regards, Art.Last edited by Art09; 01-07-2011, 09:27 AM.
Comment
-
Art,
Focus on the arrow you feel is drawn incorrectly, and look at the conditions for drawing it. Print all the values of anything used in these conditions.
Check log tab of control center for any error messages.
We have worked with you a good bit on different possibilities and offered several different approaches for debugging this. If it's beyond your current coding skill to work through this problem, then a NinjaScript consultant can help write code to your specifications.
Ryan M.NinjaTrader Customer Service
Comment
-
Hi,
Sorry, I need more help and sure that consultants will not be able to explain the cross abv/blw behavior.
I attached the screen shot and orig .cs file. The problem is I cannot understand and figure out why I see the Stoch. %K is way above 80% line and seems crossing below it but there is no arrow on the chart.
Please see attached. There are few cross below examples highlighted. I understand that using lower values for cross below lk ... if CrossBelow( ... 60, 1) may work and it does work for the third highlighted example but not for the first one...
In all highlighted cases the Stoch.%K rises above 89-94 and then clearly crossing below 80 or 75 at least. But there are no arrows on the chart. Why please? Changing BarsAgo value would cause multiple arrows per cross.
I hope we agree I cannot ask consultants about this and hope for reasonable explanations and possible solution. The rest I can figure out myself or use consultants as you've suggested many times.
My other point here is that it is probably impossible even for skilled consultants to sit and figure out every cross when what one sees is not what one gets - the %K is clearly above 80% and falling below it crossing the line visually but the cross below 80-75 does not work but cross below 60-50-40 may work... I simply not sure that some consultants will be able to fix it... Sorry.
Regards, Art.Last edited by Art09; 01-09-2011, 09:46 PM.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by sofortune, Yesterday, 10:55 PM
|
3 responses
13 views
0 likes
|
Last Post Today, 09:00 AM | ||
Started by Bobin, 03-12-2024, 08:51 AM
|
18 responses
549 views
0 likes
|
Last Post
by TaoTrader
Today, 08:48 AM
|
||
Started by sofortune, Yesterday, 09:49 PM
|
2 responses
10 views
0 likes
|
Last Post
by sofortune
Today, 08:44 AM
|
||
Started by EnveousColnago, 03-24-2020, 07:50 AM
|
8 responses
367 views
0 likes
|
Last Post
by morozg05
Today, 08:39 AM
|
||
Started by anton_tymoshchuk, Today, 01:14 AM
|
3 responses
18 views
0 likes
|
Last Post Today, 08:39 AM |
Comment