V12 Multiple targets and stops

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #221368 quote
    Albaran
    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
    robertogozzi
    Moderator
    Master

    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
    #221376 quote
    Albaran
    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
    KumoNoJuzza
    Participant
    New

    The max drawdown in Backtest is scary !!

    #221429 quote
    robertogozzi
    Moderator
    Master

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

    #221430 quote
    Nicolas
    Keymaster
    Master

    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.

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 Nicolas
2 years, 4 months ago.

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