Wait until MA crossed

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

    Hi

    Need help coding… If my system have closed a position and I want the system to wait until MA(x) is crossed until it take a new position. How do I code that?

    #176332 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Add

    AND close CROSSES OVER MA(x)

    to your conditions to enter a trade.

    umebon thanked this post
    #176334 quote
    SwingueurSwingueur
    Participant
    Average

    Hello,
    Here is a proposal so that it doesn’t rebuy if the MA was not crossed earlier.

    once aim = 0
    
    // your conditions
    
    IF close crosses over Average[X] THEN
    aim = 1
    ENDIF
    
    IF Not LongOnMarket and aim = 1 and conditions THEN
    // Buy instruction
    aim = 0
    ENDIF
    umebon thanked this post
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

Wait until MA crossed


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
umebon @umebon Participant
Summary

This topic contains 2 replies,
has 3 voices, and was last updated by SwingueurSwingueur
5 years, 1 month ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 08/27/2021
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...