Buy contract when system reaches my previous entry points

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #66479 quote
    xaji
    Participant
    Average

    Hi,

    Would be possible to create a code line that if the price is under my entry points, about 5 or 10 points, then the contract is sold, and if the points are again above of my previous entry price or equal, then I would buy a contract again.

    For example: I start buying a contract for example on 12220 points, and the points are decreasing till 12215 points, then the contract would be sold. Later the system detects that the points reaches my previous entry points (12220), then I buy the contract again, is possible to write this in pro real?

    Thanks

    #66504 quote
    Nicolas
    Keymaster
    Master

    Yes it is possible. You can place a BUY STOP order at your last known entry price level:

    test = tradeprice(1)>0
    
    if not longonmarket and test and close<tradeprice(1) then 
     buy 1 contract at tradeprice(1) stop 
    endif

    Of course the tradeprice level should be far enough from the current close, for the broker to allow it. Bear in mind that STOP order must be placed again each candle, because of their 1 bar expiration.

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

Buy contract when system reaches my previous entry points


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
xaji @xaji Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Nicolas
7 years, 11 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 03/26/2018
Status: Active
Attachments: No files
Logo Logo
Loading...