Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
MACD Crossover
Collapse
X
-
what I want is that if this MACD crosses ZeroLagMACD at the same time HMA crosses the HMA with other period then it will create an alarm and then it will the result.If the crosses above then the blue color will plot then if crosses below then red will be added to the plotted blue color.If it is flat then white will also be to the plot.
-
-
Hello! I am having a similar problem, maybe someone can help.
When I do:
I get an error on the second argument of the CrossAbove, it looks like 0 is not accepted, so how can I check if MACD is above 0?Code:if (CrossAbove(macdAvg, 0, 1)) { Print("MACD Above 0"); }
Thanks a lot!
Comment
-
yakito,
The issue is your first parameter, macdAvg. CrossAbove() is looking for a DataSeries, not a double variable. You need to provide a DataSeries to cross above zero.
For instance...
Code:if (CrossAbove(MACD(12, 26, 9).Avg, 0, 1)) { Print("MACD Above 0"); }Josh P.NinjaTrader Customer Service
Comment
-
need help guys
I have made the code to proccess buy and sell, on default RSI i have set 30 and 70......
how can i change this to 50 above 50 below instead 30 or 70... here is my broken code yet lool....
if (CrossAbove(EMA(5), EMA(12), 1)
&& RSI(21, 3).Avg[0] > 50) <------ bug 1
EnterLong ();
{
EnterLong(DefaultQuantity, "50");
}
// Condition set 2
if (CrossAbove(EMA(5), EMA(12), 1)
&& RSI(21, 3).Avg[0] < 50 ) <------ bug 2
EnterShort ();
{
EnterShort(DefaultQuantity, "20");
}
}
by the way compiles just fine, but wont function the right way.
hope this is not a funy question lool.
THANK YOU....
Last edited by XXtrem; 10-28-2010, 09:39 PM.
Comment
-
Thanks....
I do it but keep changing back to 30 / 70 again.... looks like i have to create new rsi1 or custom rsa with my default settings... I will try this method see if its working.
Originally posted by NinjaTrader_Bertrand View PostWelcome to our forums - according to your code the script would trigger on the 50 level for the RSI - do you perhaps refer to the added RSI indicator for display? You would need to change it's oversold and overbought levels (to 50 as well) to reflect what the strategy is doing.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
578 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
334 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
553 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
551 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment