Cancel operations until the next day

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #122453 quote
    Fran55Fran55
    Participant
    Veteran

    Cómo make if there are two consecutive operations with losses stop operating until the Next day.

    #122461 quote
    NicolasNicolas
    Keymaster
    Legend

    You can create a condition that count the strategyprofit decrease occurrence in the current day:

    test = summation[max(1,intradaybarindex)](strategyprofit<strategyprofit[1]) //count how many times the strategyprofit has decreased today
    
    if test < 2 and buycondition then 
     buy at market 
    endif

    Not tested, please do and give feedback.

    #122465 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Not tested:

    Once TradeON = 1
    Once Count   = 0
    If IntraDayBarIndex = 0 then
       TradeON = 1
       Count   = 0
    Endif
    If StrategyProfit < StrategyProgit[1] then
       Count = Count + 1
    Elsif StrategyProfit > StrategyProgit[1] then
       Count = 0
    Endif
    If Count >= 2 then
       TradeON = 0
    Endif
    If MyLongConditions and TradeON then
       Buy 1 contract at market
    Endif
    #122559 quote
    GraHalGraHal
    Participant
    Legend

    Links to above added as Log 202 here …

    Snippet Link Library

Viewing 4 posts - 1 through 4 (of 4 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

Cancel operations until the next day


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Fran55 @fran55 Participant
Summary

This topic contains 3 replies,
has 4 voices, and was last updated by GraHalGraHal
6 years, 7 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 03/18/2020
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...