how do i code the last n closes on a indicator? - NinjaTrader Programming | futures io social day trading

how do i code the last n closes on a indicator?
 Updated: May 6th, 2012 (04:34 PM) Views / Replies: 789 / 7 Created: May 4th, 2012 (10:36 PM) by ceramictilepro Attachments: 2

 Welcome to futures io.

# how do i code the last n closes on a indicator?

Elite Member
Roseville CA

Platform: N7
Broker/Data: Amp Futures/CQG
Favorite Futures: ES

Posts: 124 since Jun 2009

how do i code the last n closes on a indicator?

Hello,

using a std stochastics indicator,

I am trying to create a code that will draw an arrow if:

Code
 `the last 8 closes of the stochastics are above 90`
I am not looking for the last 8 closes of price just to be more clear.

Thank you for any help

 May 4th, 2012, 10:36 PM #2 (permalink) Quick Summary Quick Summary Post Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500

Posts: 46,438 since Jun 2009

I am a bit rusty, but I will try. I don't remember the Stochastic and DrawArrow overloads, but here is general idea

bool myArrowCondition = false;

if (Lowest(Stochastic(C, 1.618, 20), 8)[0] > 90) myArrowCondition = true;

if (myArrowCondition) DrawArrowUp(blah)

Mike

 The following user says Thank You to Big Mike for this post:

Elite Member
Roseville CA

Platform: N7
Broker/Data: Amp Futures/CQG
Favorite Futures: ES

Posts: 124 since Jun 2009

Big Mike
 I am a bit rusty, but I will try. I don't remember the Stochastic and DrawArrow overloads, but here is general idea bool myArrowCondition = false; if (Lowest(Stochastic(C, 1.618, 20), 8)[0] > 90) myArrowCondition = true; if (myArrowCondition) DrawArrowUp(blah) Mike

is "Lowest" acceptable?
"lowest bar" is available but that is for price I believe.

getting an error with "Lowest"

Code
 ```#region Variables bool myArrowCondition = false;```

Code
 ```if (Lowest(aDoubleStochsdot(10),8).K[0] > 90) myArrowCondition = true; if (myArrowCondition) { DrawArrowDown("My down arrow2" + CurrentBar, false, 0, High[0] + 5 *TickSize, Color.Black); }```
thank you

Market Wizard
virginia

Futures Experience: Intermediate
Platform: ninja
Favorite Futures: ES

Posts: 5,510 since Jun 2009
Forum Reputation: Legendary

ceramictilepro
Hello,

using a std stochastics indicator,

I am trying to create a code that will draw an arrow if:

Code
 `the last 8 closes of the stochastics are above 90`
I am not looking for the last 8 closes of price just to be more clear.

Thank you for any help

since you want to work with stoch the first thing you should do is making a copy of ninja stoch then work from there

Attached Thumbnails

Attached Files
 The following user says Thank You to cory for this post:

 The following user says Thank You to Zondor for this post:

Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500

Posts: 46,438 since Jun 2009

Sorry, the NinjaTrader equivalent of Lowest is MIN. Told you I was rusty!

Mike

Elite Member
Roseville CA

Platform: N7
Broker/Data: Amp Futures/CQG
Favorite Futures: ES

Posts: 124 since Jun 2009

Big Mike
 Sorry, the NinjaTrader equivalent of Lowest is MIN. Told you I was rusty! Mike

ha...np mike

 futures io > how do i code the last n closes on a indicator?

Upcoming Webinars and Events (4:30PM ET unless noted)

July

Jul 17