Adding a countdown timer to pause system

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #116534 quote
    simeong
    Participant
    Average
    if positionperf(1)<0 and positionperf(2)<0 then
    ///not sure if they is a countdowntimer available
    ///not sure how to count candels
    endif
    

     

    Hi,

     

    Just wondering if they is a way to pause a trading bot for one hour if the trading system has encountered two losses in a row ?

    #116536 quote
    Vonasi
    Moderator
    Master

    Topic moved to the correct forum. ProBuilder is for indicator topics and PrOrder is for strategy topics. Please try to post in the correct forum with future topics.

    #116540 quote
    robertogozzi
    Moderator
    Master

    Between line 1 and 4 add

    TradeON = 0

    Add AND TradeON to your conditions  to enter a trade.

    If you use a hourly TF then you can set back TradeON = 1 when OpenHour <> OpenHour[1].

    Add ONCE TradeON = 1 at the beginning of your code.

    #116557 quote
    Vonasi
    Moderator
    Master

    I coded this: (not tested)

    Add TRADEOK to your entry conditions.

    AllowedLosingTrades = 2
    
    once tradeok = 1
    
    if strategyprofit < strategyprofit[1] then
    losercount = losercount + 1
    endif
    
    if losercount = AllowedLosingTrades then
    tradeok = 0
    restarttime = time + 010000
    if restarttime >= 240000 then
    restarttime = time - 230000
    endif
    endif
    
    if not tradeok and time = restarttime then
    tradeok = 1
    losercount = 0
    endif
    #116570 quote
    GraHal
    Participant
    Master

    Above added as Log 195 here …

    Snippet Link Library

    Vonasi thanked this post
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Adding a countdown timer to pause system


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
simeong @simeong Participant
Summary

This topic contains 4 replies,
has 4 voices, and was last updated by GraHal
6 years, 1 month ago.

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