• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Values calculating crazy dare I say?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    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!
    Attached Files

    #2
    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.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by TheGameOfProbabilities, 07-18-2019, 06:56 AM
    7 responses
    35 views
    0 likes
    Last Post DaveS
    by DaveS
     
    Started by scfnkysx, Today, 12:30 AM
    0 responses
    4 views
    0 likes
    Last Post scfnkysx  
    Started by jimloforkocv, Today, 12:16 AM
    0 responses
    4 views
    0 likes
    Last Post jimloforkocv  
    Started by claxxical, Yesterday, 10:00 PM
    0 responses
    8 views
    0 likes
    Last Post claxxical  
    Started by ct, Yesterday, 08:13 PM
    0 responses
    9 views
    0 likes
    Last Post ct
    by ct
     
    Working...
    X