STOP LOSS TO MINIMIZE LOSSES

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #205914 quote
    OMXetOMXet
    Participant
    Junior

    Hi

    You all coders ;>)

    I want this to happen in sideways markets to minimize size of losses but my code skills are below par.

    // Stops and targets
    IF pPROFIT   =< 10
    THEN SET STOP pLOSS 0
    ENDIF

    SET STOP pLOSS 50
    SET TARGET pPROFIT 250

    #205932 quote
    JSJS
    Participant
    Master

    Hi @OMXet

    Is it the intention that you measure the “Range” of the sideways movement and when it is too narrow / small that you then set your stop loss to zero …?

    #205933 quote
    OMXetOMXet
    Participant
    Junior

    Hi

    Noooo, I just want to SET STOP LOSS = 0 as fast as my profit is over 10 points!!!

    #205936 quote
    JSJS
    Participant
    Master

    Hi @OMXet

    You can then use “Close-TradePrice” to see if your profit is larger than 10.
    Instead of “Set Stop pLoss 0” you can set the “Set Stop” to the level of the “TradePrice”… (BreakEven)

    If Close - TradePrice > 10 then
    Set Stop Price TradePrice
    Set Target pProfit 250
    Else
    Set Stop pLoss 50
    Set Target pProfit 250
    EndIf
    OMXet and Midlanddave thanked this post
    #206241 quote
    OMXetOMXet
    Participant
    Junior

    Thx JS

    Exactly what I was looking for ;>))

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

STOP LOSS TO MINIMIZE LOSSES


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
OMXet @omxet Participant
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by OMXetOMXet
3 years, 9 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 12/16/2022
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...