Results 1 to 2 of 2
  1. #1
    abdulaziz
    Guest

    Default How to write on chart?

    sir,
    kindly go thru the code pasted below

    Public sub OnTick(SymbolName)


    if not SymbolInfoDouble( CSTR(SymbolName) ,2,askValue) then
    MsgBox ErrorDescription(GetLastError())
    End if


    'SetPricelabel 0,CSTR(objID),PRICE_LABEL_POSITION,CDbl(askValue)
    if SymbolName = "ZINC JULY-N" or SymbolName = "LEAD JULY-N" Then
    if SymbolName = "ZINC JULY-N" Then
    pricea = askValue
    elseif SymbolName = "LEAD JULY-N" Then
    priceb = askValue
    end if


    msgbox pricea-priceb
    end if
    End Sub

    In the code above i am displaying the result of 'pricea - priceb' in MsgBox. instead of MsgBox how to display it on chart window ?
    i tried many ways and failed. Could you please privide me the code to solve the problem.
    I am so thankful to you.
    Last edited by abdulaziz; 07-01-2015 at 08:14 AM.

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

    Default

    Dear abdulaziz ,

    We have in VTL CreateObjectLabel method that create Label which appeared according to position you defined on the chart ,

    try this code and let me know if you need any things

    Code:
    Public sub OnTick(SymbolName)
    
    
    if not SymbolInfoDouble( CSTR(SymbolName) ,2,askValue) then 
    MsgBox ErrorDescription(GetLastError())
    End if
    
    
    
    
    'SetPricelabel 0,CSTR(objID),PRICE_LABEL_POSITION,CDbl(askValue)
    if SymbolName = "ZINC JULY-N" or SymbolName = "LEAD JULY-N" Then
    if SymbolName = "ZINC JULY-N" Then
    pricea = askValue
    CreateObjectLabel 0,0,"pricea",50,50,CSTR(pricea) 
    elseif SymbolName = "LEAD JULY-N" Then
    priceb = askValue
    CreateObjectLabel 0,0,"priceb",50,50,CSTR(priceb)
    end if
    
    
    end if
    End Sub
    Last edited by Rawan-HS; 07-01-2015 at 10:14 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Error When chart periodicity is changed
    By Edakad in forum VertexFX API/VTL Forum
    Replies: 6
    Last Post: 12-10-2014, 12:23 PM
  2. Time shown on Chart and Trade not same
    By nhasan in forum VertexFX API/VTL Forum
    Replies: 5
    Last Post: 09-24-2013, 04:39 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
  •