Close cross over without MTF

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #186954 quote
    SnorreDKSnorreDK
    Participant
    Junior

    Hi.

    How do i code CB2 and CS2 to make them same as CS1 and CB1 to not needing MTF?

    timeframe(30minutes, updateonclose)
    L30 = Low
    H30 = high
    
    timeframe(Default) //3 min
    
    cb1 = (close crosses over H30)
    cs1 = (close crosses under L30)
    
    CB2 = close crosses over HIGHEST[10](close)
    CS2 = close crosses under Lowest[10](close)
    
    IF A=1 then
    IF CB1 THEN
    BUY 1 CONTRACTS AT MARKET
    ENDIF
    
    IF CS1 THEN
    SELLSHORT 1 CONTRACTS AT MARKET
    ENDIF
    endif
    
    If A=2 then
    IF CB2 THEN
    BUY 1 CONTRACTS AT MARKET
    ENDIF
    
    IF CS2 THEN
    SELLSHORT 1 CONTRACTS AT MARKET
    ENDIF
    endif
    
    SET STOP %LOSS 2
    SET TARGET %PROFIT 2
    
    #186976 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    There you go:

    CB2 = close crosses over HIGHEST[10](close)
    CS2 = close crosses under Lowest[10](close)
    
    IF A=2 then
    IF CB2 THEN
    BUY 1 CONTRACTS AT MARKET
    ENDIF
    
    IF CS2 THEN
    SELLSHORT 1 CONTRACTS AT MARKET
    ENDIF
    endif
    
    SET STOP %LOSS 2
    SET TARGET %PROFIT 2
Viewing 2 posts - 1 through 2 (of 2 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

Close cross over without MTF


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
SnorreDK @snorredk Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzirobertogozzi
4 years, 8 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 01/29/2022
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...