Resources and libraries for programmers from MQL4 EA to PRT
Forums › ProRealTime English forum › ProOrder support › Resources and libraries for programmers from MQL4 EA to PRT
- This topic has 45 replies, 5 voices, and was last updated 7 years ago by
Nicolas.
-
-
09/28/2017 at 10:22 AM #47625
Basically nope to all questions. There are differences between MQL and PRT.
-Variables are all global and don’t have to be defined first. You simply start using a variable and PRT determines it type by the value you assign to it.
-the only possibility for external routines (indicators) is the call-command which so far is pretty slow so the common solution is to copy all code in you strategy to avoid the call-command.
-initial menu is not possible
-static parameters you can set in the code with the “once”-command
09/28/2017 at 10:25 AM #47626Apparently, in the next version of PRT we will be able to call procedures (or sub-routines as you say), but for now, we, unfortunately, need to specify each variable and piece of code we want to use in the EA (except Indicators which you can call).
The coding structure in PRT is more aking to that of VBA rather than a structured language such as what you may be used to.
Most of us here have adapted to this but others have decided to rather stick to Metatrader.
But do not underestimate what is still possible. We have found interesting ways to make stuff work and the ProRealCode community is always willing to assist.
09/28/2017 at 10:44 AM #47629ok .. thanks for the precious informations, I’m trying to get into PRT programming logic.
More than to VBA, PRT it’s more like IBM Basic or Microsoft Basic in ’70 and ’80 years .. I’m started from there. Except at least there were the GOTO and GOSUB commands that allowed jumps .. so with the PRT we are back. 🙂
Anyway I go on with the study, I’ve seen worse: Have you ever programmed an HP28S? 😀
09/28/2017 at 10:54 AM #47630PRT is a little bit restricting in its possibilities (and we all hope that this or that feature will be covered in futures updates) anyway PRT makes strategy development very easy and fast, so you can test a lot of ideas with little programming effort. This I consider an advantage since we have to test 1001 things to find something that works.
09/28/2017 at 11:07 AM #47634In fact.. I think the PRT is suitable for studying strategies rather than for an automated trading system .. I’m afraid I can not translate my MT4 trading system. For example, I had programmed a more efficient trailing system which in real time it changes the pips distance from the price after a series of analyzes and study of the chart in the current timeframe + other timeframes. Really very efficient and powerful .. but without the sub routines it is practically impossible to accomplish ..
09/28/2017 at 11:16 AM #47635You can still dynamically change the pip distance from the price after a series of trades.Use a variable to define the target or pip distance from the entry price using (PositionPrice).
Use a variable to define the target or pip distance from the entry price (PositionPrice) and update it based on previous trade performance.
Just loop through your last x trades using;
For i = 1 to x Do
If positionperf(i) >= condition or strategyprofit[i] >= condition Then
//increment counter or update variable here
EndIf
NextMultiple timeframe support, unfortunately, is also still on its way with the next version. But we have ways around this.
09/28/2017 at 11:20 AM #47637is ther an instruction like this?
o = iClose(Symbol(), PERIOD_H1, 7);
with it I can have, in this case, the price of a closing a candle 7 time oldest, in a time frame different from that in the chart.
For me this is crucial to setting an efficient EA.. man would not open and close positions without analyzing more TF, the same must be able to do the EA.
This is for me a fundamental principle that can not be overcome.09/28/2017 at 12:03 PM #4764909/28/2017 at 12:38 PM #47659By utilizing multiples of the current timeframe i.e. close[x*y] and commands like DOpen(x) or DClose(x), you can still perform calculations based on higher timeframes.Unfortunately, you cannot access lower timeframes.
Unfortunately, at this stage, you cannot access lower timeframes.
09/28/2017 at 4:44 PM #47699Remember it is not necessary to re-invent the wheel. If you provide the logic to what you want to achieve we can re-use code that we already developed. For example here is one of my own Ichimoku Strategies (No money management module): https://www.prorealcode.com/topic/ichimoku-strategies-general-discussion/ We also have various pieces of money management code that can be used.
Hi juanj
I have read all your code, interesting. I would like to ask you if it is possible when I backtest it to automatically activate in the chart the main indicators used, in particular ichimoku, adx, rsi… thank you.
09/28/2017 at 5:22 PM #4770509/28/2017 at 5:36 PM #47707ok
TS = (highest[T](high)+lowest[T](low))/2 //Tenkan-Sen
TS is the value of Tenkan-Sen at current price/time candle, If I want to take from the Tenkan-Sen curve the previous value of the previous candles? Candle 0, candle 1 , candle 2, from right to left where candle 0 is the current candle.
Thank’s again
09/28/2017 at 5:52 PM #4770809/28/2017 at 5:58 PM #4770909/28/2017 at 6:07 PM #47711 -
AuthorPosts
Find exclusive trading pro-tools on