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 DannyP96, 05-18-2026, 02:38 PM
    1 response
    27 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    117 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    69 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    226 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    415 views
    0 likes
    Last Post CaptainJack  
    Working...
    X