Strategy in two different timeframes

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #91054 quote
    CrillezzCrillezz
    Participant
    Veteran

    Can anyone help me. I trying to build a startegy in 1min timeframe. It looks for short signals only. Let’s say when strategy has a short signal on 1m timeframe when close <movingavarage 5. But I also want a red Heikin-Ashi candle on 1 hour timeframe. Someone who can tell if it works

    #91072 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Try this one (not tested):

    TIMEFRAME(1 hour,updateonclose)
    // Heikin-Ashii candle setup
    if barindex > 0 then
       xClose  = (open+close+low+high)/4
       xOpen   = (xOpen[1]+xClose[1])/2
       //haHigh  = Max(xOpen, xClose)
       //haLow   = Min(xOpen, xClose)
       //xHigh   = Max(High,haHigh)
       //xLow    = Min(Low,haLow)
    else
       xClose  = (open+close+low+high)/4
       xOpen   = (Open[1]+Close[1])/2
       //haHigh  = Max(xOpen, xClose)
       //haLow   = Min(xOpen, xClose)
       //xHigh   = Max(High,haHigh)
       //xLow    = Min(Low,haLow)
    endif
    Cond1 = xOpen > xClose                     //BEARish HA candlestick
    
    TIMEFRAME(1 minute,updateonclose)
    Cond2 = close < average[5,0](close)        //current price < SMA5
    
    TIMEFRAME(default)
    IF Cond1 AND Cond2 AND Not OnMarket THEN
        SELLSHORT 1 CONTRACT AT MARKET
    ENDIF
    SET TARGET pPROFIT 50
    SET STOP   pLOSS   20

    You must launch it from a 1-minute chart (or below, provided 1 hour and 1 minute are multiples of that TF).

    coincatcha thanked this post
    #91125 quote
    CrillezzCrillezz
    Participant
    Veteran

    Thanks so much. It opened a whole new world to me.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Strategy in two different timeframes


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Crillezz @crillezz Participant
Summary

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

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 02/11/2019
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...