Results 1 to 4 of 4
  1. #1

    Default PositionGetDouble dont gives open price

    I am using PositionGetDouble POSITION_PRICE_OPEN,openprice in AUD/JPY . But it gives open price 0.

    Please reply.

  2. #2
    Administrator Rawan-HS's Avatar
    Join Date
    Apr 2015
    Posts
    339

    Default

    Dear BGT

    You have to make sure that you are selecting the position using PositionSelect method before getting any position's data

  3. #3

    Default

    I have already done it. Sending the code for your reference
    for i=1 to PositionTotal()
    'AlertMessage("i = " & i)
    PositionTicket=PositionGetTicket(clng(i))
    'AlertMessage("i = " & i & " PositionTicket= " & PositionTicket)
    PositionSelect(clng(PositionTicket))
    AlertMessage("GetPositionSymbol() = " & GetPositionSymbol() & "cstr(symbol)" & cstr(symbol) & "i = " & i & " PositionTicket= " & PositionTicket & "type = " & getPositionType())
    if(GetPositionSymbol() = cstr(symbol)) Then
    newOrder = false
    PositionGetDouble POSITION_TP,tpn

    SymbolInfoDouble cstr(symbol),SYMBOL_ASK,Ask
    SymbolInfoDouble cstr(symbol),SYMBOL_BID,Bid
    PositionGetDouble POSITION_PRICE_OPEN,openprice

  4. #4
    Administrator Rawan-HS's Avatar
    Join Date
    Apr 2015
    Posts
    339

    Default

    Quote Originally Posted by BGT View Post
    I have already done it. Sending the code for your reference
    for i=1 to PositionTotal()
    'AlertMessage("i = " & i)
    PositionTicket=PositionGetTicket(clng(i))
    'AlertMessage("i = " & i & " PositionTicket= " & PositionTicket)
    PositionSelect(clng(PositionTicket))
    AlertMessage("GetPositionSymbol() = " & GetPositionSymbol() & "cstr(symbol)" & cstr(symbol) & "i = " & i & " PositionTicket= " & PositionTicket & "type = " & getPositionType())
    if(GetPositionSymbol() = cstr(symbol)) Then
    newOrder = false
    PositionGetDouble POSITION_TP,tpn

    SymbolInfoDouble cstr(symbol),SYMBOL_ASK,Ask
    SymbolInfoDouble cstr(symbol),SYMBOL_BID,Bid
    PositionGetDouble POSITION_PRICE_OPEN,openprice

    You have to make sure that you declare the variable such as the openPrice

    Code:
     
      Dim OpenPrice
      Dim Bid
      Dim Ask
       Dim Symbol

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. I can't get lot value from Open Position
    By younes4sami in forum VertexFX API/VTL Forum
    Replies: 1
    Last Post: 06-21-2015, 08:03 AM
  2. Need more price like LTP, Open and close price etc...
    By sanjaydelvadiya in forum VertexFX API/VTL Forum
    Replies: 2
    Last Post: 03-31-2014, 12:01 PM
  3. How can I get SL/TP of an open position?
    By nhasan in forum VertexFX API/VTL Forum
    Replies: 15
    Last Post: 07-21-2013, 07:45 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •