Cancel operations until the next day

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

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

    #122461 quote
    Nicolas
    Keymaster
    Master

    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
    robertogozzi
    Moderator
    Master

    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
    GraHal
    Participant
    Master

    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.

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 GraHal
5 years, 11 months ago.

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