How to get tradeprice of first order where cumulative orders taken?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #88546 quote
    schizzschizz
    Participant
    Average

    Hi,

     

    I would be grateful for help on the following question. I have a strategy which uses multiple orders. I’m aware the most recent entry price can be obtained using the tradeprice(1) instruction. How could I obtain the first entry price where multiple orders have been taken?

    ie. Tradeprice (n) where n is the countofpositions

    I suppose I could write it to a variable on opening the first order in a cumulative set, or is there a better way?

    #88547 quote
    NicolasNicolas
    Keymaster
    Legend

    You can retrieve the “n” variable dynamically with COUNTOFPOSITION

    #88563 quote
    schizzschizz
    Participant
    Average

    Thanks Nicolas. Not sure why but command ‘tradeprice(countofposition)’ does not work correctly. I have however solved the issue by setting a variable with the initial order tradeprice.

    #88569 quote
    NicolasNicolas
    Keymaster
    Legend

    Yes because COUNTOFPOSITION depends of how much Lots / Shares or contracts  you have launched at market obviously, I should have been more precise.

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

How to get tradeprice of first order where cumulative orders taken?


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
schizz @schizz Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by NicolasNicolas
7 years, 9 months ago.

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