Exit position on current bar closing

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #32006 quote
    bsjbsj
    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
    Stratus6Stratus6
    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
    bsjbsj
    Participant
    New

    Hi Stratus6

    Thanks very much for your reply.

    But any coding for nextbarclose ?

     

    Thank you

    BSJ

    #32308 quote
    GraHalGraHal
    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.
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

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

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