v10.3 Re-entry into market at last entry once tp achieved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #155678 quote
    Kovit
    Participant
    Senior

    Hi guys,

    Please can someone help with a coding headache?

    Would it be possible in v10.3 for an automated strategy to remember the last price entry point for a successful scalping long trade and re-enter once the price has crossed under but then backover? Hope that makes sense.:)

    My logic is that on a market sideways day there is money to be made in the small increases before the price fluctuates back down to the baseline.

    I’m aware that it can be done with Arrays in v11 but I’m waiting for some of the bugs to be ironed out before migrating over.

    Thanks in advance.

    #155682 quote
    robertogozzi
    Moderator
    Master

    Don’t worry, PRT use an array themselves, it’s TRADEPRICE(n).

    IF (n) is omitted or is equal to 1, then it refers to the most recent price (bear in mind that it can be either an entry or an exit price).

    If you are OnMarket then TRADEPRICE(1) is the last entry price and TRADEPRICE(2) is the previous trade’s exit price, etc….

    If you are NOT OnMarket then TRADEPRICE(1) is the last trade’s exit price and TRADEPRICE(2) is the last trade’s entry price, etc…

    Things get complicated when you accumulate positions, since any trading price will increase that array, so you will have to keep track of them in a different way.

    #155687 quote
    Kovit
    Participant
    Senior

    Thanks as always Roberto that’s perfect. I’ll add it in and run some tests now.

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

v10.3 Re-entry into market at last entry once tp achieved


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Kovit @kovit Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Kovit
5 years, 1 month ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 12/30/2020
Status: Active
Attachments: No files
Logo Logo
Loading...