Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
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:
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
-
Welcome 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.BertrandNinjaTrader Customer Service
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 brunoviveiros, 02-17-2020, 05:31 AM
|
4 responses
63 views
0 likes
|
Last Post Today, 06:25 AM | ||
Started by volIQ, 03-27-2024, 04:28 PM
|
3 responses
21 views
0 likes
|
Last Post
by RJay
Today, 05:41 AM
|
||
Started by Nickgiaco, 02-26-2024, 10:23 AM
|
2 responses
72 views
0 likes
|
Last Post Today, 05:12 AM | ||
Started by Johndc, Today, 04:39 AM
|
0 responses
8 views
0 likes
|
Last Post
by Johndc
Today, 04:39 AM
|
||
Started by johntraderuser2, Today, 02:34 AM
|
0 responses
11 views
0 likes
|
Last Post Today, 02:34 AM |
Comment