You need to enable JavaScript in order to visit our site!
 
Logo PTMC
NAVIGATION
CANCEL
 
or via PTMC account
Restore password
or via PTMC account
Logo PTMC
NAVIGATION
or via PTMC account
Restore password
or via PTMC account
or via PTMC account
Restore password
or via PTMC account

LastUpdateTime

property
Time of last order update

Syntax

public DateTime LastUpdateTime { get; }

Example


using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using PTLRuntime.NETScript;

namespace OrderClassExamples
{    
     public class OrderClassExamples : NETStrategy
     {
         Position[] All_pos;
         Order[] All_ord;
         string ord_Id;
         
         public override void OnQuote()
         {
             //Check how much positions we have
             All_pos = Positions.GetPositions();
             All_ord = Orders.GetOrders(false);

             if(All_pos.Length==0)
             {
                 //There is no open positions, lets create BuyLimit
                 if(All_ord.Length==0)
                 {
                     NewOrderRequest request = NewOrderRequest.CreateBuyStop(Instruments.Current,1,1970,Accounts.Current);
                     ord_Id = Orders.Send(request);
                 }
     	
                 //Lets check all orders and cancel order with some order ID      
             }
             
             if(All_ord.Length!=0)
             {
     			for(int i=0;All_ord.Length-1>i;i++)
         		{
         			if(All_ord[i].Id==ord_Id)
 				    {
				
 				    //if we want to see all Properties of this order we have to do such operations:
 				    Print(All_ord[i].Account);
 				    Print(All_ord[i].Amount);
 				    Print(All_ord[i].AutoTradeOrder);
 				    Print(All_ord[i].CloseTime);
 				    Print(All_ord[i].Comment);
 				    Print(All_ord[i].CurrentPrice);
 				    Print(All_ord[i].ExpirationTime);
 				    Print(All_ord[i].FilledAmount);
 				    Print(All_ord[i].FillPrice);
 				    Print(All_ord[i].GroupId);
 				    Print(All_ord[i].Id);
 				    Print(All_ord[i].Instrument);
 				    Print(All_ord[i].IsActive);
                     Print(All_ord[i].IsGroupPart);
 				    Print(All_ord[i].IsReplaceable);
 				    Print(All_ord[i].IsStopLossOrder);
 				    Print(All_ord[i].IsTakeProfitOrder);
 				    Print(All_ord[i].LastUpdateTime);
 				    Print(All_ord[i].LinkedTo);
 				    Print(All_ord[i].MagicNumber);
 				    Print(All_ord[i].Price);
 				    Print(All_ord[i].RemoteId);
 				    Print(All_ord[i].Side);
 				    Print(All_ord[i].StopLimitPrice);
 				    Print(All_ord[i].StopLossOrder);
 				    Print(All_ord[i].TakeProfitOrder);
 				    Print(All_ord[i].Time);
 				    Print(All_ord[i].TimeInForce);
 				    Print(All_ord[i].Type);
								
 				    //if we want to modify this order we have to do such operations:
 				    ReplaceOrderRequest ror = new ReplaceOrderRequest();
 				    ror.Price=1953;
 				    ror.Type=OrdersType.Limit;
 				    All_ord[i].Modify(ror);
 				
 				
 				    //We get order with ID=ord_Id and now we can do such operations:
 				    All_ord[i].Cancel();
 				    All_ord[i].RemoveStopLoss();
 				    All_ord[i].RemoveTakeProfit();
 				    All_ord[i].SetStopLoss(1950);
 				    All_ord[i].SetTakeProfit(1980);
 				    }
                 }
             }
         }
     }
}
 
Discussion
Join PTMC community to post your comments
No comments yet. Be the first.
PTMC is a professional trading platform that combines all the best charting and analytical tools to trade on different financial markets. It is developed by PFSOFT UK LTD, a global provider of trading technology for banks & brokers
© 2024. PTMC is based on Protrader technology
PFSOFT UK LTD
71-75, Shelton Street,
Covent Garden,
London, WC2H9SQ,
United Kingdom
Support & Development
PFSOFT Ukraine
Office #701
Mechnikova Street, 10B
49000, Dnipro, Ukraine
Contact us
Phone: +380 56 740 30 01
E-mail: info@protrader.org
Skype: PTMC_support
Find more ways to contact
Join us in social networks