Help with CALL code
Forums › ProRealTime English forum › ProOrder support › Help with CALL code
- This topic has 10 replies, 6 voices, and was last updated 6 years ago by
Leo.
-
-
08/06/2016 at 4:43 PM #11303
Hi. I’m trying to figure out the CALL instruction from one indicator to Proorder. A simple test shows it works, but I encountered a syntax error here that I can’t figure out. Please help.
the Indicator and the code is. error is attached.
cheers Kasper
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071//Heikin-Ashi turning points//Indicatoronce t=1once a0=(close)once a1=(close)once a2=(close)once a3=(close)if t=1 and close>a3 thena0=a1a1=a2a2=a3a3=closeelsif t=1 and close<a0 thent=-1a1=a3a0=a3a3=closeelsif t=-1 and close<a3 thena0=a1a1=a2a2=a3a3=closeelsif t=-1 and close>a0 thent=1a1=a3a0=a3a3=closeendifcc = customcloseIf cc crosses over a0 thenlong=1elselong=0endifif cc crosses under a0 thenshort=-1elseshort=0endifReturn Long COLOURED(255,0,0), short COLOURED(0,0,255)// PROORDER:// Conditions to enter long positionsmylong, myshort = call "Heikin-Ashi turning points"IF NOT LongOnMarket AND mylong THENBUY 1 CONTRACTS AT MARKETENDIF// Conditions to exit long positionsIf LongOnMarket AND not mylong THENSELL AT MARKETENDIF// Conditions to enter short positionsIF NOT ShortOnMarket AND myshort THENSELLSHORT 1 CONTRACTS AT MARKETENDIF// Conditions to exit short positionsIF ShortOnMarket AND not myshort THENEXITSHORT AT MARKETENDIF// Stops and targets : Enter your protection stops and profit targets here08/06/2016 at 5:41 PM #11308Hi,
I think your CALL instruction in the first line in ProOrder wants to know what kind of close you want to call the indicator “Heikin-Ashi turning points” with, because in ProBuilder this indicator has a “custom close” inside it. So, if you want to call it using just a simple close for example, it would be:
1mylong, myshort = call "Heikin-Ashi turning points"(close)But if you want to call it using lows as customclose for example, rather than simple close, then it would be:
1mylong, myshort = call "Heikin-Ashi turning points"(low)I’d say that’s the missing expression in parenthesis the error message talks about: saying in parenthesis at the end of the line what kind of close you want.
08/06/2016 at 6:26 PM #11310Hi Noobywan
thanks very much for your quick respond:-) of cause now it’s obvious. Because there are two kind of close’s in the indicator. this code did it.
1mylong, myshort = call "Heikin-Ashi turning points"(customclose)08/06/2016 at 6:57 PM #11314I just updated the CALL instruction definition and examples in the documentation, FYI.
http://www.prorealcode.com/documentation/call/
1 user thanked author for this post.
11/14/2018 at 12:35 PM #84841Hi all.
I use for the first time a Call functiin for my strategy.
When run it. It qrite the fuction at the bottom.
How exacly CALL works in an active strategy?
How does prorealtime knows when it starts the called indicator and the atrategy code?
I also try to use the indicator in a multiframe. At it doesnt work.
Thanks for replies.
11/14/2018 at 12:45 PM #84842I almost never used CALL because it made backtest slower and I preferred embedding the indicator within the code. Now things must have changed, because PRT was due to load any CALLed indicator together with a strategy, thus making it available as if it were written inline and it appears this improvement is working now, so CALLing an indicator from a strategy should be just like any function in all languages.
CALLing should be working in all TF’s, provided you CALL it from the TF you want and, if you CALL it from more than one TF you need to assign its returned values to variables named differently:
12345678TIMEFRAME(Daily)MAdaily = CALL "MyAverage"(200)TIMEFRAME(4 hours)MAh4 = CALL "MyAverage"(200)TIMEFRAME(1 hours)MAh1 = CALL "MyAverage"(200)..11/14/2018 at 12:59 PM #84846thus making it available as if it (CALL) were written inline
So are we saying that a CALL does not now slow down Backtests?
Anybody done any trials / tests between a CALL being made available / written inline by PRT and the Indicator being written inline by the System Author?
11/14/2018 at 2:03 PM #84849If you have a strategy CALLing an indicator open the trading panel with all strategies and their performances, click on the version of the strategy and you should see the embedded CALLed indicator.
I’ve seen it once I made a test.
I guess it wasn’t like that before!
Nicolas might be of help.
11/14/2018 at 2:31 PM #84856click on the version of the strategy and you should see the embedded CALLed indicator.
Oh yeah I’ve seen it loads and when backtesing a previously Forward Tested System (which I have copied back in the backtest screen) I have to rem out the Return line (or is that rem out the whole Indicator … I cant remember, even though I’ve done it dozens of times! 🙂 ) .
11/14/2018 at 2:33 PM #84857I am not in my conputer at the moment .yesterday I tryin demo to open a strategy with thr neural network.
When the neural network shows the same predictions in differents time frame then it opens a trade. But… I got an error like “error number 37”. I think.
And then I see that probuilder copy the neural networ at the end of the code.
I just rename the output as you explain.
But rename every single variable of the neural network. It’s crazy
11/16/2018 at 7:47 AM #84985Hi all.
I am try to use my neural network wiht a call function.
Now I wonder if prorealcode open the fuction every time load with DEFPARAM preloadbar and get the value.
Then it means that the neural network is only learning from data 10000 bar ago although, for example, the strategy is already running 20000 bars.
Can someone ( maybe from ProRealTime support) clarify more?
Thanks in advance
-
AuthorPosts
Find exclusive trading pro-tools on