xx = Sum(Buy,i ); // counting of long trades. xx will not get a higher value until a new long position is Open
// therefor if we only allow one long and one short position (Exrem() ) xx can also be used as an identification
// number for the diffrent positions.
yy = Sum(Short,i);
if( Buy[i]==1) PlotText("LONG : " + xx[i] + "\nBuyPrice: "+ BuyPrice[ i ], i, H[ i ]-dist, colorBlack, bcolor );
if( Short[i]==1 ) PlotText( "SHORT : "+ yy[i]+ "\nShortprice: "+ ShortPrice[ i ], i, L[ i ]+dist, colorBlack, bcolor );
}
The above code in my statergy plots the trade counts as below screenshoot.
It counts the trades from the first bar on the chart.
But I want it should count the trades for the current date only.
Also it consumes a lot of memory I think as the afl becomes very slow.
Please help me and suggest amendement in the above code.
People on this forum generally don’t respond very well to queries of the form “Can you write my code for me?”. You will get a much better response if you try your best to write some code, analyze where things are going wrong, and then ask for help when you get stuck.
If you want to count the number of entries that have occurred so far on each day, you could start with something like the following untested code:
I tried using your code and could correctly captured the total buy trades and short trades for the current date , JUST NOW I GOT MY FIRST SUCCESS !!! THANKS A A LOT.
now my next targets are to capture:
TOTAL NUMBER OF LOSS TRADES FOR THE DAY =
TOTAL NUMBER OF PROFIT TRADES FOR THE DAY =
TOTAL LOSS/PROFIT FOR THE DAY =
Please give me some hint codes and I will work on it and do it.
I am a new bee and a non tech guy, please help.