Announcement

Collapse
No announcement yet.

Comparing minute by minute Candlesticks

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

  • Comparing minute by minute Candlesticks

    I have searched high and low and have not been able to find any posts that address my following issues.

    I have been working on an EFS based on candlesticks and moving averages, that monitors time periods greater than 1 minute.

    Although I am assessing e.g. a 5 minute time-frame, I am running my EFS in a 1 minute chart. By running the 5 minute EFS in a 1 minute chart, it allows me to monitor the progression of the candlestick as it forms;

    e.g. in the first minute (of a 5 minute interval) I get a small UP candle
    in the second minute (of a 5 minute interval) the candle gets bigger.
    NOTE: At the end of each minute I am using "setBarBGColor" to show whether it is going UP or DOWN

    1) Is it possible to take the result of the first minute and hold or store it somehow so that it can be compared with the second minute result at the end of the second minute and represent the results of the comparison on a 1 minute chart, green for UP and red for DOWN. My plans are to determine and display the trend of the candlesticks across multiple time-frames.

    2) In my code I have // out setComputeOnClose(); therefore on every tick the EFS runs and re-calculates based on the change to the candlestick. Is it possible to have the EFS re-calculate every 15 or 30 seconds ?


    Here is a sample of part of the code so far;

    function preMain() {
    setPriceStudy(false);
    setStudyTitle("5 Minute");
    setShowCursorLabel(false);
    setPlotType(PLOTTYPE_INSTANTCOLORLINE, 0);
    setPlotType(PLOTTYPE_INSTANTCOLORLINE, 1);
    // setComputeOnClose();

    }

    function main(Length,K,D,Upper,Lower) {

    if((open(0, inv(5)) > ema(3, inv(5))) && (close(0, inv(5)) >= ema(3, inv(5))) &&
    (open(0, inv(5)) > close(0, inv(5))) ){
    setBarBgColor(Color.RGB(255,0,0));
    } else if((open(0, inv(5)) < ema(3, inv(5))) && (close(0, inv(5)) <= ema(3, inv(5))) &&
    (open(0, inv(5)) < close(0, inv(5))) ){
    setBarBgColor(Color.RGB(0,255,0));
    }
    }

    Thanks in advance to those who can help or provide me with any suggestions on how to proceed from here.
Working...
X