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.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    71 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    39 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    63 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    62 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    53 views
    0 likes
    Last Post CarlTrading  
    Working...
    X