Add position if in profit

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #186914 quote
    UkDownUnder
    Participant
    Average

    H, I’m looking for some prompts on….

    Add position if in profit

    or

    Add position if point size is > than 15

     

    with Regards, Thanks

    #186925 quote
    robertogozzi
    Moderator
    Master

    There you go

    N = 0    //or 15 or any treshold you prefer
    ProfitPips = PositionPrice * PositionPerf / PipSize
    If ProfitPips > N then
       If LongOnMarket then
          Buy 1 contract at Market
       Elsif ShortOnMarket then
          Sellshort 1 contract at Market
       Endif
    Endif
    UkDownUnder thanked this post
    #186933 quote
    Nicolas
    Keymaster
    Master

    You can check positionperf for a positive order (in profit):

    if positionperf(0) > 0 then 
     buy at market 
    endif

    or a distance in points:

    if close - tradeprice > 15 * pointsize then 
     buy at market 
    endif
    UkDownUnder thanked this post
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Add position if in profit


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
UkDownUnder @jamescoop Participant
Summary

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

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 01/29/2022
Status: Active
Attachments: No files
Logo Logo
Loading...