DEFPARAM CumulateOrders

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #10216 quote
    grizzly
    Participant
    Average

    Hi all,

    Does anyone know how to put a maximum condition around DEFPARAM CumulateOrders = True ?

    Something like this, returns a Syntax error:

    if maxposition then 
    DEFPARAM CumulateOrders = True
    endif
    Maxposition = countofposition[0]<50 and countofposition[0]>-50 //Max 50 long or 50 Short
    
    
    #10217 quote
    grizzly
    Participant
    Average

    Wrapping the If statement around the Entry trade order doesn’t work either because the system will add to a position >50 and then not exit the entire position and is then stopped out.

    I.e. Position was 48. TS added 12 to give 60. Since 60 > 50 the TS then doesn’t exit.

    #10224 quote
    Nicolas
    Keymaster
    Master

    DEFPARAM must be the very first instruction(s) at the beginning of the code, it can’t be anything else above it and so you can’t wrap it in in any condition.

    grizzly thanked this post
    #10380 quote
    David
    Participant
    Veteran

    Hi Grizzly I’m intrigued on something that will open up to 50 positions.

    Why have you got: “countofposition[0]>-50"  What's the intention?

    Both Long and Short positions are absolute?

    Also why not just code it like:

    Maxposition = COUNTOFPOSITION <= 50 
    #10393 quote
    grizzly
    Participant
    Average

    Hi dwgfx – Because it needs a lower bound for short positions. Otherwise cumulate orders can exceed -50…-100…-200 etc

    #26298 quote
    jonjon
    Participant
    Average

    Hi grizzly. I have just come across your topic from last year. I don’t know where you got on it however I’ve been looking at it recently and there is a discussion I set up (and solutions) here:

     

    Limiting accumulating orders & Fuse

     

    Hope this helps

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

DEFPARAM CumulateOrders


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
grizzly @grizzly09 Participant
Summary

This topic contains 5 replies,
has 4 voices, and was last updated by jonjon
8 years, 11 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 07/05/2016
Status: Active
Attachments: No files
Logo Logo
Loading...