Graph number of trades

Forums ProRealTime English forum ProOrder support Graph number of trades

Viewing 4 posts - 1 through 4 (of 4 total)
  • #24775

    Hi coders

    I’ve been trying to use the graph instruction to display number of trades as in the statistic of a backtest. But when accumulating orders it not straight forward with a counter.

    Does anyone have an idea on how to graph this?

    cheers Kasper

    #24977

    An idea would be to fetch through all tradeindex within a loop to count them all.

    #96797

    Hi all,

    was looking at this problem myself, and have come up with the following code. In a cumulating trades setting, it counts number of total trades, and number of long/number of short.

    A word of caution though – it slips up on same bar entry/exits – it won’t count a trade if it opens and closes on the same bar, or if a trade netts off to no position in the same bar – an example picture is attached. This same bar close count problem might be overcome with an additional condition?

    Graph tradenum, longcount and shortcount to see results.

     

    Regards,

    Finning

     

    #96804

    You could do something like this to record mid candle trades.  It does not allow for spread so you might want to factor that in in some way when comparing to the high and low of a candle.

    This is the long only version. Not tested and written during first cup of coffee of the day!

     

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

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