×

Sign up and get MultiCharts free

Use its powerful simulation mode with data included out of the box. Just fill out the form and start honing your trading skills with a few clicks.

Changes - MultiCharts

Changes

Jump to navigation Jump to search

Why an Order Was or Was Not Executed

1,667 bytes added, 19:03, 3 July 2012
Created page with "It is a common situation when a customer expects an order to be generated and executed or vice versa not be generated and not to be executed at a particular place on chart. Ad..."
It is a common situation when a customer expects an order to be generated and executed or vice versa not be generated and not to be executed at a particular place on chart. Adding the following line under the same conditions right before the line, generating your buy/sell orders will help you to understand at what particular bar, when and at what price is your order triggered in code:
<br>
<br>
'''print("The date is ", DateToString(DateToJulian(Date)), ", time is ", TimeToString(ELTimeToDateTime(Time)), ", bar # is ", maxbarsback+currentbar-1, ", market position on chart is", MarketPosition, ", market position at broker is", MarketPosition_at_Broker, ", here a LIMIT/STOP order to BUY/SELL is generated by the script at ", "100 price (example)");'''
<br>
<br>
<div style="background-color: #E5F6FF;">'''Example''': ...<br>If condition1 = true and condition2 = false then begin<br>print("The date is ", DateToString(DateToJulian(Date)), ", time is ", TimeToString(ELTimeToDateTime(Time)), ", bar # is ", maxbarsback+currentbar-1, ", market position on chart is", i_marketposition, ", market position at broker is", i_MarketPosition_at_Broker, ", here a LIMIT/STOP order to BUY/SELL is generated by the script at ", "100 price");<br>sellshort next bar at 100 limit;<br>end;</div>
<br>
If the script is applied to your chart and it is opened in PowerLanguage Editor, you will be able to see the following line in the Output tab:
<br>
<br>
'''The date is 03.07.2012, time is 18:45:00, bar # is 4362.00, market position on chart is 1.00, market position at broker is 1.00, here a LIMIT order to SELL is generated by the script at 100 price'''

[[Category:FAQ]]

Navigation menu