stop automatic intraday system for the day after 3 trades

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #44622 quote
    HenryHenry
    Participant
    Average

    A request that was addressed to ProRealTime:

     

    I am looking for the code to stop an automatic intraday system for the rest of the day after 3 consecutive winners or losses on one day.

    if intradaybarindex=0 then
    countperf=0
    sensperf=0
    endif
    
    if POSITIONPERF(1) <> POSITIONPERF(1)[1] then
    if POSITIONPERF(1) > 0 then
    if sensperf=1 then
    countperf=countperf+1
    else
    countperf=1
    sensperf=1
    endif
    elsif POSITIONPERF(1) < 0 then
    if sensperf=-1 then
    countperf=countperf+1
    else
    countperf=1
    sensperf=-1
    endif
    endif
    endif
    countcondition=countperf<3
    
    Note: You have to add countcondition to your buy and sell conditions.
Viewing 1 post (of 1 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

stop automatic intraday system for the day after 3 trades


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Henry @henry Participant
Summary

This topic contains 1 voice and has 0 replies.

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