static stop below lowest of entry bar?

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

    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
    robertogozzi
    Moderator
    Master

    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.

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 robertogozzi
5 years, 5 months ago.

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