Time Stop of an order and based on a condition

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #119688 quote
    t.bremardt.bremard
    Participant
    New

    hello

     

    i open a position with trailing stop

    i am looking for instruction to time stop the position

    rule is: exit long position 1 hour after the open long if price is below price of buy.

    is it possible ?

    #119689 quote
    fifi743fifi743
    Participant
    Master

    to try

    if condition then
     buy n contract at market
     temp =time
     endif 
    if temp+010000 > time and close<positionprice then
     sell at market 
    endif
    #119690 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    I moved this topic to the English support forum.

    Please use the correct language and forum. Thank you. šŸ™‚

    #119695 quote
    VonasiVonasi
    Moderator
    Master

    I’m not sure that works fifi743 as temp+010000 will greater when it is set at the open.

    You also have to consider what happens when the day changes.

    if condition then
     buy n contract at market
     exittime =time + 010000
    if exittime >= 240000 then 
    exittime = exittime - 240000
    endif
    endif 
    
    if onmarket and time >= exittime and close < positionprice then
     sell at market 
    endif
    #119698 quote
    fifi743fifi743
    Participant
    Master
    if not onmarket then 
    temp=250000
     endif
    if condition then
     buy n contract at market
     temp =time
     endif 
    if temp+010000 < time and close<positionprice then
     sell at market 
    endif
    

    yes i made a mistake

    #119729 quote
    t.bremardt.bremard
    Participant
    New

    Thank you very much

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

Time Stop of an order and based on a condition


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
t.bremard @t-bremard Participant
Summary

This topic contains 5 replies,
has 4 voices, and was last updated by t.bremardt.bremard
6 years, 7 months ago.

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