V12 Multiple targets and stops

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #221368 quote
    AlbaranAlbaran
    Participant
    Average

    Hi there,

    Very simple question; is there a specific syntax/command for automated trading regarding the set up of multiple stops?

    I haven’t seen any information about this, anywhere..

    Cheers,

    #221369 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    You can’t set multiple stops automatically.

    You will have to deal with each one yourself. Besides, you can’t use pending STOP/LIMIT orders to partially close positions.

    You will have to check when each candle closes if a price level has been hit, then exit AT MARKET:

    MyLongConditions = Not OnMarket AND Close CROSSES OVER average[100,0](close)
    IF MyLongConditions THEN
       BUY 3 Contracts at Market  //assu,e the entry price is 1000
       Stop1 = close - 350*PipSize
       Stop2 = close - 250*PipSize
       Stop3 = close - 150*PipSize
       Flag  = 0
       SET TARGET PRICE close + 900*PipSize
    ENDIF
    IF close <= Stop1 THEN    //close all positions at this level
       SELL AT MARKET
    ELSIF close <= Stop2 AND OnMarket AND Flag = 0 THEN //close 1 position
       SELL 1 Contract AT MARKET
    Flag = 1
    ELSIF close <= Stop3 AND OnMarket AND Flag = 1 THEN //close 1 position
       SELL 1 Contract AT MARKET
    Flag = 2
    ENDIF
    graphonprice TradePrice
    graphonprice Stop1 coloured("Gold")
    graphonprice Stop2 coloured("Fuchsia")
    graphonprice Stop3 coloured("Red")

    Tested on DAX, 1-hour TF.

    Albaran thanked this post
    x-5.jpg x-5.jpg
    #221376 quote
    AlbaranAlbaran
    Participant
    Average

    Aah that is what I understood – that partial closure was possible – with the new feature of multiple stops and targets from V12!

    My bad, but thanks anyways!

    #221406 quote
    KumoNoJuzzaKumoNoJuzza
    Participant
    New

    The max drawdown in Backtest is scary !!

    #221429 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    This is not a real strategy, it’s just an example.

    #221430 quote
    NicolasNicolas
    Keymaster
    Legend

    that partial closure was possible – with the new feature of multiple stops and targets from V12!

    Yes with manual orders.

    Albaran thanked this post
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

V12 Multiple targets and stops


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Albaran @albaran Participant
Summary

This topic contains 5 replies,
has 4 voices, and was last updated by NicolasNicolas
3 years, 1 month ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 09/21/2023
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...