Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
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 for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
how to setup condition which change another condition in strategy?
Hello guys, I am struggling finish my automatic strategy. Strategy is nearly done, just missing one last step. Hope it will be more clear from picture
I have a strategy which works with 3 indicators.
One shows me high/low till 15:30
Second shows me high/low of a day.
third shows me EMA slope (green, grey, red)
Situation 1:if ema slope is green-> if open> "high till 15:30 "= buy signal
Situation 2:if ema slope turns red -> since that time if open > high of a day = buy signal.
If EMA slope is green whole day, my entries are based on "high till 15:30" whole day.. But if Ema slope turns red (at least once, no matter if it turns back to green again) - since that moment entries only: if open > "current high of day" = buy signal(no high till 15:30 anymore...
my problem is that I do not know how to code that change. Basically - if indicator EMA slope turns red, I need to replace order (if open> "high till 15:30 "= buy signal) by order (if open > "current high of day"= buy signal).
Hope it makes some sence what I am trying to code. Will be glad for any advice.
Concrete codes for my strategy:
1. "If open> high till 15:30 -> buy"(that is what I want until some indicator change does not appear)
if (Open[0] >= HiLoOfTimeRange_WithTargetNT7(8, 0, 15, 30, 0, 0).TheHigh[0]
&& EMA (100)[0] > EMA(200)[0]
&& Open[0] > EMA(100)[0]
&& ToTime(Time[0]) >= ToTime(15, 30, 0)
&& ToTime(Time[0]) <= ToTime(21, 30, 0))
{
EnterLong(DefaultQuantity, "high breakout");
}
2. "indicator change". If that condition appears, it will trigger a change.
I just do not know how to make it work all together. I was thinking about using Count if somehow, but I am not sure. Will be glad for any idea or advice. I tried ninjatrader support, but no luck.
Can you help answer these questions from other members on NexusFi?
Thank you for your advice, I will definitely do some research. To be honest, I am not very good with Ninjascript and never heard about boolean flags before. Do you know any code, or example how it works and how to use it in coding? I will try my research anyway hopefully will find some info. Thank you for your advice once again anyway!
I have been trading for some time the Alpha Trading Method (and been posting trades to both the thread ATM Trading Method Vendor Free ( and my personal trading journal (.
Credit for the initial posting of the ATM method goes to JDNeeman and …
At the start of the strategy you will see various booleans that drive particular behavior..
Like rleplae suggests reading that thread will definitely hep you learn many things and you should.
Basically if you are going to get to code, you need to have a basic idea of syntax and programming or every small obstacle will tire you. If you haven't gone through NinjaTrader Version 7 please go through to begin with.
In your case in the variable section declare the following: