I would like to create an AddOn to exit a Long position when for example the open of today is greater than 2 days ago for unmanaged approach.
I was thinking something like this in the AddOn:
public static Order SubmitProfit(int selectedBarsInProgress, OrderAction orderAction, OrderType orderType, int quantity, double TakeProfit, string oco, string signalName) {
double openPrice = Open.GetValueAt(CurrentBar);
double openPrice2DaysAgo = Open.GetValueAt(CurrentBar - 2);
if (openPrice >= openPrice2DaysAgo)
{
SubmitOrderUnmanaged(selectedBarsInProgress, orderAction, orderType, quantity, limitPrice, 0, oco, signalName);
}
}
Could you please give me some hints about the parameters/object I need to pass to the AddOn to make it working?
Thank you.

Comment