none
Help with code Last Bold Cannot get to work Help RRS feed

  • Question

  • Net Profit: IIf([tradetype]="C",IIf([price]<=[lower strike],[option premium],IIf([price]>[higher strike],(([higher strike]-[lower strike])*([num opt]*-100)+[option premium]),(([price]-[lower strike])*([num opt]*-100)+[option premium]))),IIf([tradetype]="P",IIf([price]>=[higher strike],[option premium],IIf([price]<[lower strike],(([higher strike]-[lower strike])*([num opt]*-100)+[option premium]),(([price]-[higher strike])*([num opt]*100)+[option premium]))),IIf([tradetype]="W",[option premium],0))),IIf([tradetype]="CLS",[option premium],0)))

    All the code works except the last IIf  that I made BOLD

    Tuesday, December 18, 2012 6:48 PM

All replies

  • Jerry,

    A couple of comments. First, at least on my screen, no bold shows up in your post. When you say it doesn't work, what exactly doesn't it do? Second, for those of us not intimately familiar with what you are trying to do, what are you trying to do? An example or some words of explanation would help us understand the complex formula.

    You have several custom fields used in your formula. Are they all extra text fields or a mixture of field types? Sometimes the wrong field type can cause a formula to hiccup.

    The best way to develop and troubleshoot a complex formula such as this is to first break it into manageable parts, perhaps in several custom fields. Get each one to work separately before combining them into one big complex formula.

    John

    Tuesday, December 18, 2012 9:43 PM