Cross Abv/Blw - Double arrow question - futures io
futures io



Cross Abv/Blw - Double arrow question


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Al2010 with 8 posts (0 thanks)
    2. looks_two gulabv with 4 posts (4 thanks)
    3. looks_3 sam028 with 2 posts (2 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 3,729 views
    2. thumb_up 7 thanks given
    3. group 4 followers
    1. forum 15 posts
    2. attach_file 8 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

Cross Abv/Blw - Double arrow question

(login for full post details)
  #1 (permalink)
Al2010
 
 
Posts: 50 since Oct 2010
Thanks: 36 given, 10 received

Hello,
I'm new to C#-Ninja programming and cannot figure out the problem. Is there a way to display only one arrow per cross please? Please see attached screen shot. Is there error in the code(attached)?
I'd appreciate if anyone would be willing to help. This should be simple problem for any experienced programmer. And I hope it is not too much to ask to share your knowledge resolving this simple matter.
Thank you very much.

Attached Thumbnails
Click image for larger version

Name:	CrossAB_DblArrow.jpg
Views:	94
Size:	146.2 KB
ID:	27916  
Reply With Quote

Journal Challenge April 2021 results (now extended!):
Competing for $1800 in prizes from Jigsaw
looks_oneMaking a Living with the Microsby sstheo
(82 thanks from 10 posts)
looks_twoDeetee’s DAX Trading Journal (time based)by Deetee
(25 thanks from 9 posts)
looks_3Salao's Journalby Salao
(24 thanks from 6 posts)
looks_4Learning to Profit - A journey in algorithms and optionsby Syntax
(12 thanks from 7 posts)
looks_5Maybe a little bit different journalby Malykubo
(5 thanks from 2 posts)
 
Best Threads (Most Thanked)
in the last 7 days on futures io
futures io site changelog and issues/problem reporting
73 thanks
The Crude Dude Oil Trading System
73 thanks
Would You Sell Your System?
71 thanks
FIO Journal Challenge - April 2021 w/Jigsaw Trading
32 thanks
Big Mike in Ecuador
25 thanks
 
(login for full post details)
  #3 (permalink)
 cory 
the coin hunter
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
 
cory's Avatar
 
Posts: 6,042 since Jun 2009
Thanks: 854 given, 7,910 received


you could add a flag inside red arrow condition then check for it before moving on to orange arrow.

Reply With Quote
The following user says Thank You to cory for this post:
 
(login for full post details)
  #4 (permalink)
Al2010
 
 
Posts: 50 since Oct 2010
Thanks: 36 given, 10 received


cory View Post
you could add a flag inside red arrow condition then check for it before moving on to orange arrow.

Thank you. I tried flag but it does not work. I do not really know how to do this correctly. If you or anyone can share a small example then please do so.
I tried the following:

if (K[0] <= 80 && K[0] >= 70)
{
if (CrossBelow(Stochastics(PeriodD, periodK, smooth).K, 80, 1))
RedFlag = true;
DrawArrows(2, 9); // Red arrow
}
else if (K[0] <= 70 && K[0] >= 60)
{
if (CrossBelow(Stochastics(PeriodD, periodK, smooth).K, 70, 1))

if RedFlag == false
DrawArrows(2, 4); // Orange arrow
OrangeFlag = true;
}
RedFlag = false;
OrangeFlag = false;


Thank you in any case.

Reply With Quote
 
(login for full post details)
  #5 (permalink)
 sam028 
Site Moderator
 
 
sam028's Avatar
 
Posts: 3,670 since Jun 2009
Thanks: 3,789 given, 4,505 received

How about using K[1] ?

 
Code
                            
if (K[0] <= 80 && K[0] >= 70){
  if (
CrossBelow(Stochastics(PeriodDperiodKsmooth).K801))
    
DrawArrows(29);  // Red arrow}
  
else 
    if (
K[0] <= 70 && K[0] >= 60) {
      if ( (
CrossBelow(Stochastics(PeriodDperiodKsmooth).K701))  && (K[1] < 70 || K[1] >80))
        
DrawArrows(24); // Orange arrow


Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote
The following user says Thank You to sam028 for this post:
 
(login for full post details)
  #6 (permalink)
Al2010
 
 
Posts: 50 since Oct 2010
Thanks: 36 given, 10 received


sam028 View Post
How about using K[1] ?

 
Code
                            
if (K[0] <= 80 && K[0] >= 70){
  if (
CrossBelow(Stochastics(PeriodDperiodKsmooth).K801))
    
DrawArrows(29);  // Red arrow}
  
else 
    if (
K[0] <= 70 && K[0] >= 60) {
      if ( (
CrossBelow(Stochastics(PeriodDperiodKsmooth).K701))  && (K[1] < 70 || K[1] >80))
        
DrawArrows(24); // Orange arrow




Thank you very much!

Reply With Quote
 
(login for full post details)
  #7 (permalink)
Al2010
 
 
Posts: 50 since Oct 2010
Thanks: 36 given, 10 received


sam028 View Post
How about using K[1] ?

 
Code
                            
if (K[0] <= 80 && K[0] >= 70){
  if (
CrossBelow(Stochastics(PeriodDperiodKsmooth).K801))
    
DrawArrows(29);  // Red arrow}
  
else 
    if (
K[0] <= 70 && K[0] >= 60) {
      if ( (
CrossBelow(Stochastics(PeriodDperiodKsmooth).K701))  && (K[1] < 70 || K[1] >80))
        
DrawArrows(24); // Orange arrow



Almost works but still getting double arrows at some places and no arrows at other places where there used to be an arrow.
Thank you.

Reply With Quote
 
(login for full post details)
  #8 (permalink)
 sam028 
Site Moderator
 
 
sam028's Avatar
 
Posts: 3,670 since Jun 2009
Thanks: 3,789 given, 4,505 received

Try to put some print (with Print() ) some values before each DrawArrows(), it will help you to find what's wrong in your logic.
With only a small part of the indicator, it's hard for us to find what could be wrong.

Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote
The following user says Thank You to sam028 for this post:
 
(login for full post details)
  #9 (permalink)
Al2010
 
 
Posts: 50 since Oct 2010
Thanks: 36 given, 10 received


sam028 View Post
Try to put some print (with Print() ) some values before each DrawArrows(), it will help you to find what's wrong in your logic.
With only a small part of the indicator, it's hard for us to find what could be wrong.


Hello Sam,
First, I truly appreciate your help.
If you have time and will please see attached compiled .cs file. I'm using 6E 300 volume chart for my testing. There are many double arrows with the approach you have suggested. It is impossible for me to figure out what is wrong and how to fix it. If you can please help. If not then I still truly thank you very much.

Attached Thumbnails
Click image for larger version

Name:	DblArrow01.jpg
Views:	84
Size:	248.2 KB
ID:	27979   Click image for larger version

Name:	TestCase_NoArrow.jpg
Views:	57
Size:	216.0 KB
ID:	27980  
Attached Files
Register to download File Type: cs MyStochArrow.cs (12.5 KB, 12 views)
Reply With Quote
 
(login for full post details)
  #10 (permalink)
 gulabv 
Dallas, TX
 
Experience: Beginner
Platform: Ninjatrader
Broker: Zen-Fire
Trading: ZN, 6E
 
gulabv's Avatar
 
Posts: 286 since May 2010
Thanks: 161 given, 167 received


Do you really need CalculateOnBarClose = false ?

The way this indicator is coded currently you could get multiple draw object painted on the chart for each 300 volume bar as the COBC = false setting analyzes your code on each incoming tick. I would think you want to set COBC = true so that your criteria is checked each time a bar completes. Not sure what you are trying to do so I can only speculate this might alleviate the problems you are seeing...

Hope this helps,
gulabv

Reply With Quote
The following user says Thank You to gulabv for this post:
 
(login for full post details)
  #11 (permalink)
Al2010
 
 
Posts: 50 since Oct 2010
Thanks: 36 given, 10 received


gulabv View Post
Do you really need CalculateOnBarClose = false ?

The way this indicator is coded currently you could get multiple draw object painted on the chart for each 300 volume bar as the COBC = false setting analyzes your code on each incoming tick. I would think you want to set COBC = true so that your criteria is checked each time a bar completes. Not sure what you are trying to do so I can only speculate this might alleviate the problems you are seeing...

Hope this helps,
gulabv


Thank you for your advice. I forgot to reset COBC = true. This is how it ment to be COBC=true. But setting Calc on Bar Close = true does not help. All I'm trying to do is simply get every cross below/abv. if there is a lower high and cross below 80-70 false then I still would like to get an arrow at cross below 60-50...
My test case is Euro 300 volume chart-Jan-06-11 @13:10 (1:10 p.m) US Eastern time. There is a lower high on price and cross below 80-75 does not work. But cross below 60 will work. There is another case - 11/26-10 @ 2:23 a.m. where cross below 80 does not work but cross below 75 will work...
If you know any other way to complete this I'd appreciate if you share.
Thank you very much.

Reply With Quote
 
(login for full post details)
  #12 (permalink)
 gulabv 
Dallas, TX
 
Experience: Beginner
Platform: Ninjatrader
Broker: Zen-Fire
Trading: ZN, 6E
 
gulabv's Avatar
 
Posts: 286 since May 2010
Thanks: 161 given, 167 received

Al,

I have added some conditional logic to display only one arrow per direction (short/long).

Attached Files
Register to download File Type: cs MyStochArrow.cs (12.9 KB, 22 views)
Reply With Quote
The following user says Thank You to gulabv for this post:
 
(login for full post details)
  #13 (permalink)
Al2010
 
 
Posts: 50 since Oct 2010
Thanks: 36 given, 10 received


gulabv View Post
Al,

I have added some conditional logic to display only one arrow per direction (short/long).


Thank you very much! It seems to work finally. I need to test it more to be sure.
There is still another problem-the program is missing a lot of good crosses. The whole idea of using multiple if's... was about to get the arrow at every tradeable cross such as if there is lower high and cross blw 75-80% false then go deeper and look for deeper cross.
I do not know why but I see that Stoh.K clearly crossing 80% or below at many places but there is no arrow...
Thank you very much again. I truly appreciate your help!

Reply With Quote
 
(login for full post details)
  #14 (permalink)
 gulabv 
Dallas, TX
 
Experience: Beginner
Platform: Ninjatrader
Broker: Zen-Fire
Trading: ZN, 6E
 
gulabv's Avatar
 
Posts: 286 since May 2010
Thanks: 161 given, 167 received

I didn't really spend any time trying to understand the logic behind the code just added the flag to eliminate duplicate arros.
If I get some time over the weekend I will try to understand what you wrote and try to fix the indicator.
Always interesting to see how other futures.io (formerly BMT) members trade.
Thanks for sharing.

gulabv

Reply With Quote
The following user says Thank You to gulabv for this post:
 
(login for full post details)
  #15 (permalink)
Al2010
 
 
Posts: 50 since Oct 2010
Thanks: 36 given, 10 received


gulabv View Post
I didn't really spend any time trying to understand the logic behind the code just added the flag to eliminate duplicate arros.
If I get some time over the weekend I will try to understand what you wrote and try to fix the indicator.
Always interesting to see how other futures.io (formerly BMT) members trade.
Thanks for sharing.

gulabv


You are very kind, thank you.
Please see attached screen shots with missing arrows followed by some lower high examples.
The whole idea is based on TopDogTrading methodology, which I think is the best and most affordable etc...
Thank you very much.

Attached Thumbnails
Click image for larger version

Name:	MissedCrosses.jpg
Views:	77
Size:	281.6 KB
ID:	28009   Click image for larger version

Name:	LowerHighExamples.jpg
Views:	60
Size:	253.7 KB
ID:	28010   Click image for larger version

Name:	MajorCross_NoArrow.jpg
Views:	52
Size:	268.1 KB
ID:	28015  
Reply With Quote
 
(login for full post details)
  #16 (permalink)
 gulabv 
Dallas, TX
 
Experience: Beginner
Platform: Ninjatrader
Broker: Zen-Fire
Trading: ZN, 6E
 
gulabv's Avatar
 
Posts: 286 since May 2010
Thanks: 161 given, 167 received


Al2010 View Post
missing arrows followed by some lower high examples.

Must have to do with your checking the value of previous bar (K[1]) in addition to checking for the cross below the specific K value of the current bar. Check the values of K[1] for the missing arrows and see if the condition fails hence no arrow painted.

Reply With Quote
The following user says Thank You to gulabv for this post:


futures io Trading Community Platforms and Indicators NinjaTrader > Cross Abv/Blw - Double arrow question


Last Updated on January 9, 2011


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Journal Challenge w/$1,800 in prizes!

April
 

Seven Trading Mistakes Solved With Smart Trading Tools w/Brannigan Barrett

Elite only
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts