4.6.2 Special Orders: Difference between revisions
From MultiCharts
m
no edit summary
(Created page with " The signal can generate special exit order types, besides price and market orders such as: ProfitTarget, StopLoss, BreakEven, DollarTrailing, PercentTrailing, ExitOnClose. S...") |
mNo edit summary |
||
(3 intermediate revisions by 3 users not shown) | |||
Line 26: | Line 26: | ||
GenerateProfitTarget(5); | GenerateProfitTarget(5); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Sell Limit order will be generated at price = EntryPrice + ( | Sell Limit order will be generated at price = EntryPrice + (Amount/Contracts)/ BigPointValue = 12,25 + 5/100/10 = 12,255; | ||
Because the price does not correspond to the minimum price increment, it will be rounded to BETTER price, according to the step MinMove* PriceScale = 25*0,01 = 0,25 | Because the price does not correspond to the minimum price increment, it will be rounded to BETTER price, according to the step MinMove* PriceScale = 25*0,01 = 0,25 to 12,50. | ||
The final ProfitTarget order: Sell 100 contracts at 12,50 Limit; | The final ProfitTarget order: Sell 100 contracts at 12,50 Limit; | ||
</div> | </div> | ||
Line 37: | Line 37: | ||
The symbol has the following parameters: BigPointValue=100, MinMove=2, PriceScale=0,01. | The symbol has the following parameters: BigPointValue=100, MinMove=2, PriceScale=0,01. | ||
Assume the short position is opened at the average price 0,982 for 10000 contracts by the two orders SellShort1 1000 at 1,00 | Assume the short position is opened at the average price 0,982 for 10000 contracts by the two orders SellShort1 1000 at 1,00 and SellShort2 9000 at 0,98; | ||
Signal code: | Signal code: | ||
Line 48: | Line 48: | ||
GenerateStopLoss(5) in PerContract mode will generate 2 Stop orders (one exit per each entry). | GenerateStopLoss(5) in PerContract mode will generate 2 Stop orders (one exit per each entry). | ||
StopLoss order price for the first entry = EntyPrice + | StopLoss order price for the first entry = EntyPrice + Amount / BigPointValue = 1,00 + 5/100 = 1,00 + 0,05 = 1,05; considering the price step (0,02) is rounded to the WORSE = 1,06. | ||
StopLoss order price for the second entry = EntyPrice + | StopLoss order price for the second entry = EntyPrice + Amount / BigPointValue = 0,98 + 5/100 = 0,98 + 0,05 = 1,03; considering the price step (0,02) is rounded to the WORSE = 1,04. | ||
Final sending orders: | Final sending orders: | ||
Line 121: | Line 121: | ||
</div> | </div> | ||
[[Category:.NET | [[Category:4. Understanding PowerLanguage .NET]] |