How to stop taking too many trades (on every bar)

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #59798 quote
    rdcarvajal
    Participant
    New

    Hi:

    This is probably a silly question. I have a code that cumulates orders in the direction of the trend at 2ATR increments (Pyramids). I want to take up to 10 of such pyramid trades and then stop but after the 10th pyramid the system starts taking trades on every bar unless a stop is hit.

    At the moment i have a few lines of code per pyramid entry.

    My position size is based on %risk so I can’t use “COUNTOFPOSITIONS”.

    Graph attached. Please watch how after the 10th pyramid it starts taking trades on every bar.

    Any ideas how to make it stop taking new trades after the 10th? (without closing the trades so it rides the up-trend until the end)

    Thank you

    Pyramids.png Pyramids.png
    #59803 quote
    Vonasi
    Moderator
    Master

    Every time you put in a BUY order also add one to a variable.

    IF Not OnMarket THEN
    Count = 0
    ENDIF
    
    IF your conditions and count < 10 THEN
    BUY yoursize Contracts at Market
    Count = Count + 1
    ENDIF
    
    
    rdcarvajal thanked this post
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

How to stop taking too many trades (on every bar)


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
rdcarvajal @rdcarvajal Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Vonasi
8 years, 1 month ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 01/18/2018
Status: Active
Attachments: 1 files
Logo Logo
Loading...