Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Gap List for Analyzer

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

    Gap List for Analyzer

    I want to display gap up along with the percentage of the gap from yesterdays close to today's open in the MA. I want to subtract the opening price from the closing price but it does not seem to be coming out correctly.

    Value.Set(lastValue);

    if (MarketDataType.Opening>MarketDataType.LastClose)
    {
    double gapUp = MarketDataType.Opening-MarketDataType.LastClose;
    Value.Set(gapUp);
    lastValue = (int)Value[0];
    }
    Last edited by brucelevy; 09-30-2016, 07:36 PM.

    #2
    Hello,

    I believe we had previously discussed something similar involving volume which the last line looks very similar to.

    The reason for this is that the value is being cast to an Int, in this case because it is not a Volume and is a Price it is a double.

    To store the value for a double, you would need to change the private property:

    Code:
    private int lastValue;
    to
    Code:
    private double lastValue;
    And the set would then look like the following:

    Code:
    double gapUp = MarketDataType.Opening-MarketDataType.LastClose;
    Value.Set(gapUp);
    lastValue = Value[0];
    Value[0] by default would be a double


    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by bmartz, 03-12-2024, 06:12 AM
    2 responses
    19 views
    0 likes
    Last Post bmartz
    by bmartz
     
    Started by funk10101, Today, 12:02 AM
    0 responses
    3 views
    0 likes
    Last Post funk10101  
    Started by gravdigaz6, Yesterday, 11:40 PM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by MarianApalaghiei, Yesterday, 10:49 PM
    3 responses
    10 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by XXtrader, Yesterday, 11:30 PM
    0 responses
    4 views
    0 likes
    Last Post XXtrader  
    Working...
    X