Having some issues with this code. Please help. - futures io
futures io futures trading



Having some issues with this code. Please help.


Discussion in NinjaTrader

Updated
    1. trending_up 1,678 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 3 posts
    2. attach_file 0 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
 

Having some issues with this code. Please help.

(login for full post details)
  #1 (permalink)
singapore
 
 
Posts: 131 since Nov 2009
Thanks: 11 given, 7 received

 
Code
if (Close[0]<=Low[2])
{
if (BuySeqCount < 12)
{
BuySeqCount++;
DrawText("BuySeq"+CurrentBar, BuySeqCount.ToString(), 0, (Low[0]-(2*TickSize)), Color.Red);
if (BuySeqCount == 5)
{
buycountdown5 = Close[0];
Print("buycountdown5 is" + Close[0]);
}
if (BuySeqCount == 8)
{
buycountdown8 = Close[0];
Print("buycountdown8 is" + Close[0].ToString());
}
}
elseif (BuySeqCount == 12)
{
if ((Low[0] <= buycountdown8))
{
Print("Low[0] is" + Low[0]);
Print("buycountdown8 is" + Close[0]);
BuySeqCount++;
DrawText("BuySeq"+CurrentBar, BuySeqCount.ToString(), 0, (Low[0]-(2*TickSize)), Color.Red);
flagBS9 = false;
SequentialCountdownInProgress = false;
BuySeqCount = 0;
}
else
{
DrawText("BuySeq"+CurrentBar, "+", 0, (Low[0]-(2*TickSize)), Color.Red);
}
}
I want to compare the 8th count vs the 5th count and the 13th count vs the 8th count.
Problem No.1: My private double values changes.
Problem No.2: Not sure how to code the 8th vs 5th

Reply With Quote

Can you help answer these questions
from other members on futures io?
MACD line not plotting after change of plot order
NinjaTrader
Webinar: Finding your own way in trading w/Adam Grimes
The Elite Circle
Short Interest Ratio indicator?
ThinkOrSwim
Automating strategies on multiple charts with same symbol
TradeStation
COTbase for quant trading?
Elite Algorithmic NinjaTrader Trading
 
 
(login for full post details)
  #3 (permalink)
the coin hunter
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
 
cory's Avatar
 
Posts: 6,030 since Jun 2009
Thanks: 845 given, 7,894 received



Quoting 
I want to compare the 8th count vs the 5th count and the 13th count vs the 8th count.
Problem No.1: My private double values changes.
Problem No.2: Not sure how to code the 8th vs 5th

your codes will get more complicate as you compare more and more variables
the best practice is to save those values into an array, due to Ninja programming (think of it a perm loop for each new bar added it will start back from bar #1 again) the values stored in the array will be shifted but they are in there you just have to know which is which.

// declare an array in #region Variables

private double[] arrayGap = new double[13000];
....
// example to store value into an array
// do gap storing into an array
 
Code
arrayGap[Cnt] = Instrument.MasterInstrument.Round2TickSize(Open[0] - Close[0]);
// use print to debug
// Print(" current open "+Open[0]+ " prior close " + gapLast);

good luck.

Reply With Quote
The following user says Thank You to cory for this post:
 
(login for full post details)
  #4 (permalink)
singapore
 
 
Posts: 131 since Nov 2009
Thanks: 11 given, 7 received

Thanks Cory! Feels like it's back to the drawing board for now!

Reply With Quote


futures io Trading Community Platforms and Indicators NinjaTrader > Having some issues with this code. Please help.


Last Updated on March 4, 2010


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
 

Importance of Finding Your Own Way w/Adam Grimes

Elite only
 

Journal Challenge w/Jigsaw

April
     



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