PDA

View Full Version : MQL to VTL conversion -- help needed



soori1234
01-30-2014, 05:08 PM
Hi..
I converted MQL Script to VTL script. But when I am running it is taking very long time for execution and it is not giving the desired output.I converted correctly but I don't know where the error is. Can any one solve my issue by running the script on my machine through Team Viewer.?

Thank You..

Hassan-HS
01-30-2014, 07:32 PM
Hello soori,


it seems loops issue,you have to check it, or send me the code and i will check it for you :D

soori1234
01-31-2014, 06:23 AM
Hi.. These are my MQL and VTL scripts.

310

311

Kindly fix the bug.

Thank you..

soori1234
01-31-2014, 11:59 AM
Hi these are MQL and VTL scripts can you fix it.?

312

313

Hassan-HS
01-31-2014, 12:06 PM
Hello,


The reason of overload is invoking a methods in on ontick event in each tick for all symbols, the correction is to invoke the method when a new tick happen in the current chart, but any way there is no output please check the conversation process again.

please study the example that will help you in creating indicators.

example:

Public Sub main()
dim highArry()
CopyHigh 0,1, bars(0),highArry
indKey=AddCustomIndicator(0,highArry,1,false)
SetDrawingStyle 0,cstr(indKey),DRAW_ARROWS
SetArrowStyle 0, cstr(indKey) ,226
LineColor 0, CSTR(indKey), RGBColor(255, 0, 0)
End Sub

Correction:





Public Sub OnTick(symbolName)
if symbolName= ChartSymbol(0) then
ObjectSeriesGetValue 0,cstr(vchartName & ".High"),CLNG(bars(CLNG(vchartId))),resultValue
ObjectSeriesSetValue 0,CSTR(indKey),CLNG(bars(CLNG(vchartId))),CDBL(res ultValue)
end if
End Sub

soori1234
02-05-2014, 01:31 PM
Hi I converted correctly. But I am unable to find out where the error is. Can you check it

314

Hassan-HS
02-05-2014, 02:41 PM
Hello Soori,

I'm here to guide you if you have a specific problems that related to VTL and API's, so in your case you have to trace your code manually.