Waiting after a loss

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #26674 quote
    verygrubbyverygrubby
    Participant
    Master

    Hello all,

    Is there a way to tell a strategy to wait before opening a new trade after a loss? e.g. If a bet loses, I want my strategy to wait 10 minutes before considering entering a trade again (i.e. it should ignore any trade signals that might occur in that 10 minute period)

    Many thanks

    Geoff

    #26739 quote
    Big HugBig Hug
    Participant
    Average

    Hi Geoff

    I’m just about to go out but you could try something like this ..this uses the bars as the time and looks to enter once the price has moved a certain distance from the first entry…

    IF c1 AND NOT LongOnMarket THEN
    BUY 2 PERPOINT AT MARKET
    ENDIF
    
    //let's add another order while price continue to move lower (more than 10 points) than the last order taken with a condition of 5 bars elapsed since then
    IF BARINDEX-TRADEINDEX(1)>20 AND Close-TRADEPRICE(1)>20 AND LongOnMarket THEN
    BUY 2 PERPOINT AT MARKET
    ENDIF
    #26760 quote
    NicolasNicolas
    Keymaster
    Legend

    You can use BARINDEX and TRADEINDEX like Big Hug said in his previous post. You can also make comparison between schedules if you store “time” in a variable, when you launch an order.

    #26763 quote
    verygrubbyverygrubby
    Participant
    Master

    thanks guys…will try that

    #26775 quote
    Big HugBig Hug
    Participant
    Average

    “You can also make comparison between schedules if you store “time” in a variable, when you launch an order”

    Hi Nicolas –

    Are you referring to

    indicator3 = //whatever your condition is
    c3 = (indicator3 >=  X )AND TIME >090000 AND TIME <200000

    If not – I wondered if you could post an example of the  code when you have a moment

    …Thanks in advance

    #26801 quote
    NicolasNicolas
    Keymaster
    Legend

    @Big Hug

    You can give a try with this code snippet for instance:

    if buycondition and minute-lasttime>10 or minute-lasttime>-50 then 
     lasttime = minute 
     buy 1 contract at market 
    endif 
Viewing 6 posts - 1 through 6 (of 6 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

Waiting after a loss


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
verygrubby @verygrubby Participant
Summary

This topic contains 5 replies,
has 3 voices, and was last updated by NicolasNicolas
9 years, 7 months ago.

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