Contracts to buy

Viewing 11 posts - 1 through 11 (of 11 total)
  • #73618

    I am trying to create code that will buy/sell contracts based on my atr and risk per trade amount i.e $250 but can’t get it to work

    #73623

    What is the ATR of the instrument that you are working on? If it is less than 50 then you will always return a value of less than 1 and PRT will buy 1 contract.

    You ENDIF is also not correctly typed but this will not be the issue.

    #73624

    Fx can be 0.00147 or an index it could be 10.2

    I thought PRT could now incorporate decimal size contracts?

    #73626

    When you say ‘can’t get it to work’ what do you mean exactly. Does it buy nothing or does it buy but only contracts of size 1?

    Have you tried graphing the myATR/25?

    #73627

    Sometimes PRT gets confused with division by zero. Try the following:

     

    #73629

    It does something just not what I wanted it to. It should have a max loss @$250 – this doesnt seem to be happening.

    Stupid q I am sure what is this graphing you are talking about?

    The code you gave me only seems to be buying 1 contract

    #73630

    Debugging in ProBacktest with GRAPH instruction

    1 user thanked author for this post.
    #73638

    I have absolutely no idea what that is :(. It might as well be written in Mandarin

    #73646

    Have you tried graphing the myATR/25?

    Type

    GRAPH myATR/250′

    at the bottom of your code and run the System and then you will see what the values are of, well errmm yes you’ve guessed it 🙂 …  myATR/250

    #73654

    Ah ok that seems simple.

    I might time my art by 100 to get number above 1 and then * 5

    #73706

    I have worked it out – At last I have a win on my side.

    The graph was what I needed – THANK YOU

    1 user thanked author for this post.
Viewing 11 posts - 1 through 11 (of 11 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login