stop automatic intraday system for the day after 3 trades

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #44622 quote
    Henry
    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.

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
Logo Logo
Loading...