I have problems with conditions

Greenlee

New Member
Joined
Aug 31, 2014
Messages
23
I think its quite complicated so I would need to show you :) but i will try

So this is my table (sheet name: BACKTESTING)
Gyazo - 18e6618f6f26ba50b4937012cb11de5a.png

This is my second sheet (sheet name BACKTESTING RESULTS)

Gyazo - 8a07ad8210ee284c294add4d27a7adb5.png

So what do I want to do:

so this is the formula for now:
=COUNTIFS(BACKTESTING!D3:D7;"=BAT";BACKTESTING!B3:B7;"=EUR/AUD";BACKTESTING!C3:C7;"=M15";BACKTESTING!K3:K7;"=1") from backtesting page but I want to add 2 more conditions from 2nd sheet
1st when you choose TF=timeframe M15 that would show results for M15 not for M5,H1 or H4 and second when I would choose on the right side EUR/AUD it would show EUR/AUD not also EUR/JPY ( dropdown of currencies) ...

If I was not understandable enough please let me know
 
Yes I understand I can swap for M5 but then the condition M15 disappear so lets say I want to keep both conditions :) when I pick M15 I would have results for M15 and when I pick M5 I would have results for M5 .)
 
Upvote 0

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
This?

Code:
=IF(F2<>"EUR/AUD","",COUNTIFS(BACKTESTING!D3:D7;"=BAT";BACKTESTING!B3:B7;F2;BACKTESTING!C3:C7;E3;BACKTESTING!K3:K7;"=1"))
 
Upvote 0
A kind of this not completely because I want AND condition what do I mean with AND condition
Code:
=IF(OR(E3<>"M15";F2<>"EUR/AUD");"";COUNTIFS(BACKTESTING!D3:D10000;"=BAT";BACKTESTING!B3:B10000;F2;BACKTESTING!C3:C10000;E3))</pre>

When I use this code it shows me results for TF: 15Minutes and pair EUR/AUD btw how do I write a code when I change TF lets say I pick TF: 1H, will show me in this square the result for TF:1H?

I hope I was clear if not please let me know
 
Upvote 0
Yes its true I pick the time frame in E3, but when I change it to TF:M5 in D2 there is no results ( only shows when i pick M15) so I need to add some code to show me results for M5 to but I don't know how to

In square D2 there is this code for M15 but I want to show me results for M5 when I pick TF: M5 in E3
Gyazo - f16fb663d020ecd3765bb27df4384ea5.png
Code:
=IF(OR(E3<>"M15";F2<>"EUR/AUD");"";COUNTIFS(BACKTESTING!D3:D10000;"=BAT";BACKTESTING!B3:B10000;F2;BACKTESTING!C3:C10000;E3))
 
Upvote 0
Oh I manage to solve it now :) and the last thing I want to add the same thing we made now with time frame I want to do with Currency so that means when I change currency that shows me different results?

Thank you very much Chris u solved me many problems really appreciate this
 
Upvote 0
For that you can just remove the IF test completely:

Code:
=COUNTIFS(BACKTESTING!D3:D7;"=BAT";BACKTESTING!B3:B7;F2;BACKTESTING!C3:C7;E3;BACKTESTING!K3:K7;"=1")
Chris.
 
Upvote 0
Much appreciate :) you are solving all my problems

I have 2 more questions

1st. How would I calculate grand total

Gyazo - 7fc06747184d98aa516350701d1b057b.png ( the picture in down right corner)

Total trades ( from all patterns ( BAT,CYPHER, DOUBLETOP.....) that I would pick only time frame and currency?

2nd question

I would like to calculate AVG WIN pips for each pattern (BAT... )

How would I like to be calculated? This is the condition
Code:
=COUNTIFS(BACKTESTING!D3:D10000;"=BAT";BACKTESTING!B3:B10000;F2;BACKTESTING!C3:C10000;E3;BACKTESTING!K3:K10000;"=1")
if this is true then it needs to sum from BACKTESTING!N3:N10000 and BACKTESTING!P3:P10000 and divide by wins of pattern D3(on sheet BACKTESTING RESULTS) ( Gyazo - 3c2a76380ebfe1d8887a0a23d58d7d83.png

Thank you
 
Upvote 0

Forum statistics

Threads
1,215,530
Messages
6,125,350
Members
449,220
Latest member
Edwin_SVRZ

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top