Page 1 of 4 123 ... LastLast
Results 1 to 15 of 46
  1. #1
    diannt
    Guest

    Default How to call MarketInfo (MQL) in VTL?

    Hello!

    I want to get current stoplevel from market. How can I do this?

    In MQL it may be done like this:
    STOPLEVEL = MarketInfo(Symbol(),MODE_STOPLEVEL);

  2. #2
    Administrator Hassan-HS's Avatar
    Join Date
    Jun 2013
    Posts
    795

    Unhappy Stop & Limit Offset

    Dears,


    Unfortunately there is no way to get Stop offset / Limit offset using VTL, you can open new suggested feature with this issue using this link .

  3. #3
    diannt
    Guest

    Default Account Info

    Thank you for answer.

    One more question.
    http://www.hybrid-solutions.com/supp...icle/View/1911 - which one of this identifiers is AccountLeverage?

  4. #4
    b_morar
    Guest

    Post Leverage

    Dear Sir,

    You can calculate the leverage (its per symbol) as following :



    Result = Contract size / Initial Margin
    Leverage=1:Result



    Contract Size = Contract size for certain symbol, contact you dealer to get it.
    Initial Margin = Initial Margin for certain symbol, contact you dealer to get it.



    Ex:

    • Contract size = 100000 .
    • Initial Margin = 250

    100000/250 = 400 so the leverage equal 1:400
    Last edited by Hassan-HS; 10-08-2013 at 01:08 PM.

  5. #5
    diannt
    Guest

    Default

    I want to know take profit, which I put on selected order. And we have 2 functions in VTL API.
    OrderGetDouble with ORDER_TP parameter and PositionGetDouble with POSITION_TP parameter.

    So, there is one simple question. Which one of them I have to use?

  6. #6
    b_morar
    Guest

    Default

    Dear Sir,

    Let's make it clear.

    If you need to get TP or SL for certain pending order do the following:

    1- Select order using OrderSelect method
    2- Use OrderGetDouble method to return (SL or TP etc..) values through ByRef parameter, and pass a value of type ENUM_ORDER_PROPERTY_DOUBLE to decide which one of information do you need (SL or TP etc..) .

    If you need to get TP or SL for certain position do the following:

    1- Select order using PositionSelect method
    2- Use PositionGetDouble method to return (SL or TP etc..) values through ByRef parameter,and pass a value of type
    ENUM_POSITION_PROPERTY_DOUBLE to decide which one of information do you need (SL or TP etc..) .

    .

  7. #7
    diannt
    Guest

    Default

    Thank you for answers!

    Now Im trying to get this code to work and I don't know how!
    I just copyed it from here
    http://www.hybrid-solutions.com/supp...icle/View/1730

    Public Sub main()
    MsgBox SymbolName(1,true)
    End Sub

    and it says "type mistmatch SymbolName".

    What's wrong with this function?

  8. #8
    Administrator Hassan-HS's Avatar
    Join Date
    Jun 2013
    Posts
    795

    Default

    Dear Diannt


    This sample is working well, but could you please check if you are wrote the name of method correctly and check if the terminal is connected and market-watch have prices.

  9. #9
    diannt
    Guest

    Default

    Quote Originally Posted by h.abukrayem View Post
    Dear Diannt


    This sample is working well, but could you please check if you are wrote the name of method correctly and check if the terminal is connected and market-watch have prices.
    h.abukrayem, thanks for answer.

    Yes, the method wrote correctly, terminal is connected and market-watch have prices.
    I don't know what's wrong with it.

    Seriously, I have no idea. I deleted all another code from my expert and it didn't help.

  10. #10
    Administrator Hassan-HS's Avatar
    Join Date
    Jun 2013
    Posts
    795

    Default

    Dear,


    Can I see your code using team-viewer?

  11. #11
    diannt
    Guest

    Default

    Thanks, h.abukrayem, to help with my code throw team-viewer, we got it to work.

    Now I have one more question.

    My current chart is in minutes, but in code I want to see High of the last day. Can I have the solution?
    Like iHigh(Symbol(),PERIOD_D1,LastDay) in MQL.

  12. #12
    Administrator Hassan-HS's Avatar
    Join Date
    Jun 2013
    Posts
    795

    Post

    Dear sir,

    Absolutely you can do that using ChartSetSymbolPeriod method.

    please check the following code.

    Code:
    Public Sub main()
    
    if  ChartSetSymbolPeriod(0,PERIOD_D1) then
    	MsgBox GetHigh(0,Bars(0))
    end if
    
    End Sub

  13. #13
    diannt
    Guest

    Default

    Okay, I got it, but in another way, because your makes troubles with charts.

    This time we used to know many candles, but VTL show us only around 800. Is there any solution?

    Also, we got an error "Invalid price", when use NewLimitOrder function, with any price. We just tried to put price by hand - higher, then price, when buystop, and lower then price - when sellstop.

    What can we do with it?
    Last edited by diannt; 10-11-2013 at 12:42 PM.

  14. #14
    Administrator Hassan-HS's Avatar
    Join Date
    Jun 2013
    Posts
    795

    Post Vtl

    Welcome


    I don't know what do you means with " makes troubles", whatever you can open new chart using VTL.

    Code:
    Public Sub main()
    
    ChartOpen "EUR/USD",PERIOD_M1
    MsgBox GetHigh(Cint(0),Bars(Clng(0))-1)
    
    End Sub
    Also, we got an error "Invalid price", when use NewLimitOrder function, with any price. We just tried to put price by hand - higher, then price, when buystop, and lower then price - when sellstop.
    Send me your code let me check your prices.

  15. #15
    diannt
    Guest

    Default

    1. By "makes troubles" I meant that when I use your code, my period of chart is changing and I have to change it back. When I do it in cycle, it's blinking.

    2. if not NewLimitOrder (-1, CSTR(SymbolName(1,true)), CDbl(1.0), CDbl(1.4)) then
    MsgBox ErrorDescription(GetLastError())
    end if

    Also, if this code is running in OnTick, it says error on symbolName, cause of OnTick function.
    We used to do
    Dim name
    sub main()
    name = SymbolName(1,true)
    end sub

    and then use "name" variable in spite of "SymbolName(1,true)".

    We tried same code with different prices - it does'nt work.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Convert from MQL to VTL
    By Snake in forum VertexFX API/VTL Forum
    Replies: 19
    Last Post: 04-21-2014, 03:02 PM
  2. Converting MQL to VTL
    By Snake in forum VertexFX API/VTL Forum
    Replies: 5
    Last Post: 01-09-2014, 12:54 PM
  3. Convert MQL EA to VTL
    By Snake in forum VertexFX API/VTL Forum
    Replies: 4
    Last Post: 09-12-2013, 08:42 AM
  4. Convert MQL EA to VTL
    By Snake in forum VertexFX API/VTL Forum
    Replies: 4
    Last Post: 09-12-2013, 08:42 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
  •