Unable to manually limit positions

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #157660 quote
    juanj
    Participant
    Master

    Can someone else confirm that the countofposition (and countoflongshares; countofshortshares) is working in v11?

    I am using conditional instructions to open a limited amount of positions but the backtest engine just keeps adding positions indefinitely:

    MaxPositions = 3
    
    If (onmarket = 0 or countofposition <= MaxPositions) and ConditionLong Then
    Buy 1 contract at market
    ElsIf (onmarket = 0 or countofposition <= MaxPositions) and ConditionShort Then
    Sellshort 1 contract at market
    EndIf
    #157661 quote
    juanj
    Participant
    Master

    Nevermind! Forgot to use abs(countofpositions)

    GraHal thanked this post
    #157670 quote
    Nicolas
    Keymaster
    Master

    Coding questions go to each of the dedicated forum sub-sections, as described in the forum rules. The ProRealTime forum is for platform questions/issues not related to programming.

    #157682 quote
    juanj
    Participant
    Master

    I am aware, thought it was a v11 bug. Turns out it was an ID10T issue

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

Unable to manually limit positions


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
juanj @juanj Participant
Summary

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

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