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 kaywai, 09-01-2023, 08:44 PM
    5 responses
    602 views
    0 likes
    Last Post NinjaTrader_Jason  
    Started by xiinteractive, 04-09-2024, 08:08 AM
    6 responses
    22 views
    0 likes
    Last Post xiinteractive  
    Started by Pattontje, Yesterday, 02:10 PM
    2 responses
    20 views
    0 likes
    Last Post Pattontje  
    Started by flybuzz, 04-21-2024, 04:07 PM
    17 responses
    230 views
    0 likes
    Last Post TradingLoss  
    Started by agclub, 04-21-2024, 08:57 PM
    3 responses
    17 views
    0 likes
    Last Post TradingLoss  
    Working...
    X