static stop below lowest of entry bar?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #143927 quote
    MnAMnA
    Participant
    New

    Amigos/friends, Im new to coding but keen.

    Question if I may…I trade futures. Once I buy (go long) and I am longonmarket…how on earth do I instruct the stoploss to remain static at the lowest point of the entry (trade entry) bar?

    Effectively I want to set my stoploss just under my entry buy bar. can anyone help?

    gracias

    #143932 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    There you go (Not OnMarket added to your entry conditions does the trick):

    IF MyLongConditions AND Not OnMarket THEN
       BUY 1 CONTRACT AT MARKET
       SET TARGET pPROFIT 100
       SET STOP   pLOSS    abs(close - low) / pipsize
    ENDIF

    Please use the correct language, I moved it from the Spanish to the English forum. Refrain from mixing languages. Thank you šŸ™‚

    #143934 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    I changed the code because I had forgotten to set it to the LOW of the entry bar.

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

static stop below lowest of entry bar?


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
MnA @aolvera Participant
Summary

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

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 09/11/2020
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...