Hello,

does anybody know if trade.marginloan also works for open positions?

I want to use it like this

< snip>
for (trade = bo.GetFirstOpenPos(); trade; trade = bo.GetNextOpenPos())


{ 

value_all_open_pos=value_all_open_pos + trade.GetPrice(i, "C") * trade.shares; 

}


my_equity [i] = value_all_open_pos + bo.cash - trade.marginloan; // I use 
margin in my system

value_all_open_pos=0; // resetting to zero for next run - necessary?

bo.UpdateStats(i, 1); 

bo.UpdateStats(i, 2);

} // End of for loop over bars

bo.PostProcess();

AddToComposite(my_equity, "~~~My_Equity","x", 1+2+8+16+32+64+128); 

}

For some reason, my_equity is higher if I use " minus trade.marginloan" (see 
above) than if I skip it. This is awkward...

Thanks

Markus

Reply via email to