Exit position on current bar closing

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #32006 quote
    bsj
    Participant
    New

    Hi All,

    Any one help me out how to put a code for exit the remaining position on current bar closing time or next bar opening time.

     

    Thanks in advanced.

    BSJ

    #32065 quote
    Stratus6
    Participant
    Junior

    For a long position have you tried

     

    Sell at market nextbaropen

     

    This command assumes you wish to close the entire position

    #32258 quote
    bsj
    Participant
    New

    Hi Stratus6

    Thanks very much for your reply.

    But any coding for nextbarclose ?

     

    Thank you

    BSJ

    #32308 quote
    GraHal
    Participant
    Master

    Without thinking of the coding niceties, sorry … and I can’t see the Insert PRT Code button anyway, sorry mods.

    Record barindex of current bar as currentbarindex and then use barindex= currentbarindex +1, conditions will then be checked at close of currentbarindex +1 and exit at next bar open (same price as previous bar close / currentbarindex +1).

    Ha … would have been easier to have coded it, maybe!?  Note to self: Code solutions or leave helping to somebody who can?? Lesson learnt for me! 🙂 

    If I could only see the Insert PRT Code button?? Do we have to live with this and I find my own work around (Nicolas or Mods) or is there a fix coming along please?

    GraHal

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

Exit position on current bar closing


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
bsj @bsj Participant
Summary

This topic contains 3 replies,
has 3 voices, and was last updated by GraHal
8 years, 10 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 04/14/2017
Status: Active
Attachments: No files
Logo Logo
Loading...