Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Values calculating crazy dare I say?
Collapse
X
-
Hello,
Thank you for the post.
I wanted to check, do you have a sample that shows the exact logic of the conditions? Unfortunately the prints would not be enough to compare against the chart without knowing the exact logic used in the conditions.
I could suggest placing prints inside of the condition and then Print the values as you have to determine why that condition is becoming true when it is.
If you have a sample that can compile, I could also review that sample to check if the condition is equating incorrectly.
Please let me know if I may be of additional assistance.
-
Values calculating crazy dare I say?
I hope I'm not wrong to post this in here, and that I actually found something! I've attached the screenshot, and I have no idea why a short position is being entered there - as my code is surely not suggesting for that to happen.
In this instance, I'm basically looking for an upper bollinger cross, and if the latest High crosses down, with a lookback period of 1, to take a short.
Then I'm checking myself to make sure that in FACT there was a cross from 1 bar ago to the most current 0 bar:
Print("High is "+High[0]+"Upper is: " +BollingerTripleState_V4NT8(numStdDev,period,narro w_Tick_Threashold,wide_Tick_Threashold,displayData ,myLines,shading,opacity).Upper[0]);
Print ("Previous high was "+High[1]+"Upper was: "+ BollingerTripleState_V4NT8(numStdDev,period,narrow _Tick_Threashold,wide_Tick_Threashold,displayData, myLines,shading,opacity).Upper[1]);
ExitLong((int)orderQuantity);
EnterShort((int)orderQuantity/2,"SUPER SHORT");
Print("SUPER SHORT ");
justEntered = true;
Print("Close = " + Close[0]);
Here is my printout:
High is 37.39 Upper is: 38.2656979107107
Previous high was 38.28 Upper was: 38.2479576975874
SUPER SHORT
Close = 36.61
One would think all is well, seemingly from previous high, to the most current high there was a cross down of upper bollinger band... Except that, look at that chart... The High before the entry, since it looks back at [0] was BELOW $37, and the one BEFORE that at [1] about $37.30; and Bollinger upper were well above $38, at about $38.35 and $38.40
Why would I be getting these values? While I wait for help, I'm going to look around myself, so let's see who gets there first!Tags: None
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by mmenigma, Today, 02:22 PM
|
1 response
3 views
0 likes
|
Last Post Today, 02:34 PM | ||
Started by frankthearm, Today, 09:08 AM
|
9 responses
35 views
0 likes
|
Last Post Today, 02:21 PM | ||
Started by NRITV, Today, 01:15 PM
|
2 responses
9 views
0 likes
|
Last Post
by NRITV
Today, 01:51 PM
|
||
Started by maybeimnotrader, Yesterday, 05:46 PM
|
5 responses
26 views
0 likes
|
Last Post Today, 01:19 PM | ||
Started by quantismo, Yesterday, 05:13 PM
|
2 responses
21 views
0 likes
|
Last Post
by quantismo
Today, 01:07 PM
|
Leave a comment: