PDA

View Full Version : Need Help for EA



BGT
01-21-2016, 01:32 PM
Hi,

Converting https://www.mql5.com/en/code/8453 in to vtl can you check and let me know your comments I seems to have some issue in Trailing..

I have attached the converted File in VTL

Thanks,

Hassan-HS
01-24-2016, 08:04 AM
Hello BGT,

For sure will take a look on you code, but at first tell me what kind of issues you faced?

Hassan-HS
01-25-2016, 03:20 PM
Dear BGT

I have checked your code and this is my notes:
The MQL code create a new market order with SL and update the SL value in trailing part,but in your code you are open a new market order without the SL value.
So you should do that :
- Use the NewMarketOrder (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1736) method to open a market order
- Use the NewSLTPOrder (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/3622) method to place the manage order(SL)
- In trailing part use UpdateSLTPOrder (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/3632) method to update the SL value.
- Use the GetPostionType (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1744) method to check the selected position type instead of OrderType (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1754)method

Check this sample that create the new market order and make the mange order on it .



Dim lot
Dim Sl
Dim TP
lot =0.1
SL= 1.08208
TP= 1.08305

Public Sub main()
NewMarketOrder 1,"EUR/USD",Cdbl(lot)
End Sub

Public Sub OnPositionTrade (actionType ,ticketID)
if actionType = 5 then
NewSLTPOrder Cdbl(ticketId),Cdbl(lot),Cdbl(SL),Cdbl(TP)
end if

BGT
01-28-2016, 10:07 AM
I have made the changed its working but when given values in M1 but when i change the ma period o higher side its not working with H1

is it the issue with buffer ??

Can you please look in to it

Rawan-HS
02-02-2016, 02:22 PM
Dear BGT

I have checked your script and I noticed that the mql4 script use simple moving average indicator and you are using MAEnvelopeOnArray.

So we already changed it to SimpleMovingAverageOnArray (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/3481) method, check the attach file .