timeframe command issue

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #161364 quote
    kevin12345
    Participant
    Average

    hi,

    I trying to go long when the 4h chart has macd green histogram with other conditions on 15mins my positions are entering when the histogram is red as well on the 4h chart. Does anyone got any ideas?

    thank you

    timeframe(4h,updateonclose)
    c3= macdredline - macdblueline > 0
    timeframe(default)
    IF (c1 or c2) and c3 and not shortonmarket and not endtime then
    BUY 1 CONTRACT AT MARKET
    ENDIF
    #161365 quote
    kevin12345
    Participant
    Average

    sorry

    “but on 15mins my positions are entering when the histogram is red as well on the 4h chart.”

    #161366 quote
    Vonasi
    Moderator
    Master

    You have not shown in your code how you define macdredline and macdblueline. You talk about the histogram so why are you referring to lines?

    The instruction to return the histogram value is MACD.

    MACD

    The lines are MACDSIGNAL and MACDLINE:

    MACDsignal

    MACDLine

    #161367 quote
    kevin12345
    Participant
    Average
    macdredline=MACDSignal[12,26,9](close)//macd signal line
    macdblueline=MACDline[12,26,9](close)//macd line
    timeframe(4h,updateonclose)
    c3= macdredline - macdblueline > 0
    timeframe(default)
    IF (c1 or c2) and c3 and not shortonmarket and not endtime then
    BUY 1 CONTRACT AT MARKET
    ENDIF
    #161368 quote
    Vonasi
    Moderator
    Master

    You are declaring the MACDSIGNAL and MACDLINE values in the default time frame and not in the 4 hour timeframe.

    timeframe(4h,updateonclose)
    c3= MACD[12,26,9](close) > 0
    
    timeframe(default)
    IF (c1 or c2) and c3 and not shortonmarket and not endtime then
    BUY 1 CONTRACT AT MARKET
    ENDIF
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

timeframe command issue


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
kevin12345 @kevin12345 Participant
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by Vonasi
5 years ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 02/14/2021
Status: Active
Attachments: No files
Logo Logo
Loading...