I am working on a custom BuildingBlock which should work similar to the "Transaction Weight" block.
It is going to be a ConditionBlock. It should generate some code after the PlaceTrade() statement as "Transaction Weight" does:
(https://www.wealth-lab.com/Support/ExtensionApi/BuildingBlock)
Any hints?
It is going to be a ConditionBlock. It should generate some code after the PlaceTrade() statement as "Transaction Weight" does:
CODE:I can't find any explanation how this can be accomplished in the API documentation
_transaction = PlaceTrade(bars, TransactionType.Buy, OrderType.Market, 0, 0, "..."); _transaction.Weight = weight[index] * -1;
(https://www.wealth-lab.com/Support/ExtensionApi/BuildingBlock)
Any hints?
Rename
All Buy and Short signals return a Transaction to a local _transaction variable, so Transaction properties can be assigned in the GenerateTransactionCode virtual method. Here's the code for Weight -
CODE:
//transaction specific code public override void GenerateTransactionCode() { string mult = Parameters[1].AsString == "Lowest Values" ? "-1" : "1"; ParentEntryExit.MainCode.Add("_transaction.Weight = <weight>[index] * " + mult + ";"); }
Your Response
Post
Edit Post
Login is required