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

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #88546 quote
    schizz
    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
    Nicolas
    Keymaster
    Master

    You can retrieve the “n” variable dynamically with COUNTOFPOSITION

    #88563 quote
    schizz
    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
    Nicolas
    Keymaster
    Master

    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.

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 Nicolas
7 years, 1 month ago.

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