Check for red or green candle before buying?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #8248 quote
    markouk
    Participant
    Average

    Does anyone know if there is a code that checks the current or previous candle before allowing a buy short or long?

    #8250 quote
    markouk
    Participant
    Average

    Might have answered my own question with this:

    IF close(1) < open THEN whatever……. (Signals that the current bar is trending upwards and is higher than the previous bar) OR

    IF close(1) > open THEN …..(Signals that the previous bar closed higher than the current bar open and thus the current bar is trending downwards).

    I think this logic is right…

    #8257 quote
    minmax
    Participant
    Average

    Yes, you have it stated correctly, the indicator below also confirms other conditions, such as.. the quantity of green/red candles, how many pips their move is, does SuperTrend confirm the trend and what is the height of the bollinger band..

    res=0
    
    // Detection of 3 green candles
    a1 = open < close and open[1] < close[1] and open[2] < close[2]
    a2 = high-low[2]>=5
    a3 = SuperTrend[7,10]<(close)
    a4 = +3.0*STD[90](close) - -3.0*STD[90](close) >20
    
    // Detection 3 red candles
    b1 = open > close and open[1] > close[1] and open[2] > close[2]
    b2 = high[2]-low>=5
    b3 = SuperTrend[7,10]>(close)
    b4 = +3.0*STD[90](close) - -3.0*STD[90](close) >20
    
    if a1 and a2 and a3 and a4 then
    res = 1
    elsif b1 and b2 and b3 and b4 then
    res = -1
    endif
    
    return res as "3up3down"
    Adolfo and grizzly thanked this post
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Check for red or green candle before buying?


General Trading: Market Analysis & Manual Trading

New Reply
Author
author-avatar
markouk @markoukay Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by minmax
9 years, 8 months ago.

Topic Details
Forum: General Trading: Market Analysis & Manual Trading
Language: English
Started: 05/27/2016
Status: Active
Attachments: No files
Logo Logo
Loading...