How to define the bar Index correctly?

Forums ProRealTime English forum ProOrder support How to define the bar Index correctly?

  • This topic has 8 replies, 4 voices, and was last updated 7 years ago by avatarBard.
Viewing 9 posts - 1 through 9 (of 9 total)
  • #31296

    Hi,
    I have code:

    Because I haven’t defined the bar index I’m seeing trades exited as long as 10 days later so I’m wondering how do I incorporate the barindex part into this code?
    (pls see screenshot)

    if I remove

    it is half as profitable so I’m not sure what that line is doing to add to the profitability?
    I’m hoping this isn’t going to be a D’oh moment…

    Thanks in advance.

    #31306

    Bar Index is the number of bars the System has been running and Trade Index is the Bar Index of the last trade.

    So last Trade at bar #100 and it is now bar #103 so your Long will exit (3 bars after entry).

    Note: I haven’t looked at screen shot or code in screen shot so if above is not what you need to know then just say?

    If Longonmarket (10 shares?) and you want to exit then it is normal to say ‘Sell at Market’ (not sell 10 shares at market).

     

    2 users thanked author for this post.
    #32071

    Cheers for the explanation Grahal,
    If you have a moment to look at the screenshot you’ll see there are trades that have been held for 10 days instead of 3 days — (eg at the bottom of the detailed report table on the 24th Feb 2017). So I can’t figure how to make it exit after 3 days, hence I was wondering if I need some other bit of code to tell the system to start counting?

    #32072

    Hi Bard

    If you put the code up as code (not an image) then I could run it and check it out better.

    But in the meantime Line  23 needs to read

    Sell at Market (not sell 10 shares at market)

    Whenever I’ve mistakenly put Sell * shares as an Exit I get an error message that it is not allowed? But I could check this out if I could run the code.

    Also Line 22 should read (bar index – tradeindex = 3) … all within brackets (you have = 3 outside the brackets).

    Apart from the above errors then as far as I can see the Trade should exit after 3 bars, but running your code on my Platform is the easiest way for me to get involved?

    GraHal

    1 user thanked author for this post.
    #32095

    Whenever I’ve mistakenly put Sell * shares as an Exit I get an error message that it is not allowed?

    Yes, because by doing this, you ask ProOrder to close partial position, but it’s not possible as you know it.

     

    #32128

    Thanks Grahal and Nicolas, right, an incorrect bracket placement issue.

    Do you know what an “X” means next to a trading system in the Indicators and Trading systems window? Pls see screen? A few have appeared next to systems and I have never seen x’s before today?

    Also is there a way of colouring the line of one of the two indicators (so you don’t have to use a cursor / mouse over on the Graph to see which is which?

    GRAPH insidebarlong
    GRAPH insidebarshort

    Cheers
    Bard

    #32133

    I think the X means that is the current one open in the window

    Cheers Kasper

     

    #32134

    I am on the phone so I don’t if the coding section will work but you can colour the graph by

    graph xxx coloured (134,231,150) as “xxx”

    1 user thanked author for this post.
    #32187

    Thanks for the graphing colour help, Elsborgtrading,
    re: the Stars next to my trading system names, the thing is, I have 3 stars now yet only one open auto system?

    Cheers
    Bard

Viewing 9 posts - 1 through 9 (of 9 total)

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