protected override void OnBarUpdate() { if(Historical){return;} for (int index = 0; index < BarsArray.Length; index++) { if (CurrentBars[index] < (slowMA+12)) return; } if(BarsInProgress == 0) { int retraceType = 0; //Is current intraday action favorable? if(Close[0] > Open[0]) { int uptrendCheckCount = 0; int countOfClosesOverSlowEma = 0; int priceLevelViolationEma = (int)Math.Round(slowMA*.85); double todaysEstimatedDailySlowMovAvg = (EMA(Closes[1],slowMA)[0] + Math.Abs(EMA(Closes[1],slowMA)[0] - EMA(Closes[1],slowMA)[1])); double keyPriceViolationLevelToday = (EMA(Closes[1],priceLevelViolationEma)[0] + Math.Abs(EMA(Closes[1],priceLevelViolationEma)[0] - EMA(Closes[1],priceLevelViolationEma)[1])); //Make sure current price is > today's estimated slow daily MA. if((Close[0] > todaysEstimatedDailySlowMovAvg) && (Close[0] < keyPriceViolationLevelToday)) { //Check for uptrend on daily for(int i = 0;i < 10;i++) { //Count up mov avg lines are stacked daily bars if((EMA(Closes[1],fastMA)[i] >= EMA(Closes[1],medMA)[i]) && (EMA(Closes[1],medMA)[i] >= EMA(Closes[1],slowMA)[i])) uptrendCheckCount++; //Count up past closes >= slow ma line if(Closes[1][i] >= EMA(Closes[1],slowMA)[i]) countOfClosesOverSlowEma++; } if((countOfClosesOverSlowEma == 10) && (uptrendCheckCount == 10)) //if it's an uptrend { retraceType = 1; Alert("Alert1" + CurrentBar, Priority.Medium, "RetraceToEMA120612-" + slowMA, "Alert2.wav", 0, Color.Aquamarine, Color.Black); } } } Plot0.Set(retraceType); } }
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Market analyzer seems, frozen..
Collapse
X
-
Market analyzer seems, frozen..
Hi. I'm trying to run market analyzer with two indicator columns, based an indicator I've developed. It's the same indicator for each column with different parameters. In the code, I set Plot() to 0 or 1, for mere observational purposes, since I code in an alert to be thrown in the indicator code. I have COBC = true. I've loaded 75 bars into MA, as well as each indicator column setting. When I run it, I don't see any 0 or 1's, just a few share prices, and then ellipses for most of the other cells. It's not updating or returning any values I expect. Any takers? My code is below...
Code:Tags: None
-
Hello CSharpTrader,
So that I can test it further can you please upload actual code (the cs file).
You may also send it to support[AT]ninjatrader[DOT]com
Please append Attn:Joydeep in the subject line of the email and give a reference of this thread in the body of the email.
I look forward to assisting you further.JoydeepNinjaTrader Customer Service
-
-
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by jxs_xrj, 01-12-2020, 09:49 AM
|
6 responses
3,290 views
1 like
|
Last Post
by jgualdronc
Today, 10:56 AM
|
||
Started by Touch-Ups, Today, 10:36 AM
|
0 responses
9 views
0 likes
|
Last Post
by Touch-Ups
Today, 10:36 AM
|
||
Started by geddyisodin, 04-25-2024, 05:20 AM
|
11 responses
62 views
0 likes
|
Last Post Today, 10:08 AM | ||
Can someone turn this thinkscript into a ninjascript. 5PM CST OHL and Previous Day
by Option Whisperer
Started by Option Whisperer, Today, 09:55 AM
|
0 responses
8 views
0 likes
|
Last Post Today, 09:55 AM | ||
Started by halgo_boulder, 04-20-2024, 08:44 AM
|
2 responses
25 views
0 likes
|
Last Post Today, 09:41 AM |
Comment