Assign a date to an order

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

    Hi there,

    I was wondering how PRT would react to the following situation:

    I want to store the date of my first order so I thought that I’d code it this way simply (the idea is that if there’s a position buildup because the market moves in an unfavorable way to my trade, below code stays valid);

    If onmarket then
    Datefirstorder = today
    elsif not onmarket then
    Datefirstorder = undefined
    endif

    But how will PRT react if the order stays pending in the market till the next day?

    Is the date defined above not going to change to the current day as the condition “onmarket” is still valid or does PRT keep the date previously set?

    #149517 quote
    JC_BywanJC_Bywan
    Moderator
    Master

    Hi,

    To store the date of your first order, considering just before it you were not on market yet (unlike during your position buildup), you could try this logic:

    If onmarket and not onmarket[1] then
     Datefirstorder = opendate
    endif
    Albaran thanked this post
Viewing 2 posts - 1 through 2 (of 2 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

Assign a date to an order


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Albaran @albaran Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by JC_BywanJC_Bywan
5 years, 10 months ago.

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