Exit parameters

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #164419 quote
    Donovan MeuwsenDonovan Meuwsen
    Participant
    New

    Hi All,

    How would you code your Exit of a long(/short) with the following conditions please?

    • Exit (StopLoss) when price hits at DoncianChannelDown(/UP) of the moment of Opening Position (so not trailing)
    • Exit (TakeProfit) when price is 1,5 x (PRICE at Opening of Position – DolcianChannelDown(/UP))

    Thanks a lot for your wisdom!

    #164434 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    There you go:

    IF MyLongConditions THEN
        BUY 1 Contract AT MArket
        SL = (close - DonchianChannelDown[20])
        TP = SL * 1.5
        SET STOP LOSS SL
        SET TARGET PROFIT TP
    ENDIF
    IF MyShortConditions THEN
        SELLSHORT 1 Contract AT MArket
        SL = (close - DonchianChannelUp[20])
        TP = SL * 1.5
        SET STOP LOSS SL
        SET TARGET PROFIT TP
    ENDIF
    #164450 quote
    Donovan MeuwsenDonovan Meuwsen
    Participant
    New

    grazie mille Roberto!

    thank you very much Roberto!

    #164452 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Only post in the language of the forum that you are posting in. For example English only in the English speaking forums and French only in the French speaking forums

    Thank you 🙂

Viewing 4 posts - 1 through 4 (of 4 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

Exit parameters


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Donovan Meuwsen @dpm380 Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by robertogozzirobertogozzi
5 years, 6 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 03/17/2021
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...