double targetPoints = Target1Dollars / Trade1Size / Instrument.MasterInstrument.PointValue;
double targetPrice = e.Order.AverageFillPrice - targetPoints;
ExitShortLimit(0, true, e.Order.Filled, targetPrice, "Profit", "Sell short #1");
double deficitPoints = Trade2DeficitDollars / Position.Quantity / Instrument.MasterInstrument.PointValue;
double nextEntry = e.Order.AverageFillPrice + deficitPoints;
EnterShortLimit(0, true, Trade2Size, nextEntry, "Sell short #2");
double deficitPoints = Trade2DeficitDollars / Position.Quantity / Instrument.MasterInstrument.PointValue;
double nextEntry = e.Order.AverageFillPrice + deficitPoints;
EnterShortLimit(0, true, Trade2Size, nextEntry, "Sell short #2");
If the target for the first trade is realized there will be no second trade taken and the target for the second trade is cancelled. If the target for the first trade is not realized but a deficit of $28 is realized then the second trade is taken in accordance with the target of the second trade.
The variable declarations are as follows:
Trade1Size = 4000;
Trade2Size = 12000;
When the second trade is entered the entries for a short target are directed by the following instructions::
double deficitPoints = Trade2DeficitDollars / Position.Quantity / Instrument.MasterInstrument.PointValue;
double nextEntry = e.Order.AverageFillPrice + deficitPoints;
EnterShortLimit(0, true, Trade2Size, nextEntry, "Sell short #2");
But what I get is as per the attached screenshot:: https://www.screencast.com/t/uoaNurwUUk
The quantity for the Exit is twice the value of Trade2Size and I would think that it should be Trade1Size +Trade2Size but I did not want to make a correction until I could understand why it was doubling the quantity..
I) have attached a copy of my <,cs.>, if needed.

Comment