Translation of EasyLanguage code
Forums › ProRealTime English forum › ProOrder support › Translation of EasyLanguage code
- This topic has 29 replies, 4 voices, and was last updated 6 years ago by
Vonasi.
-
-
08/20/2018 at 7:10 PM #78682
I think that if you are going to use TP and SL levels on an index such as the DJI then it is much better to set them with a percentage rather than a fixed pip amount because as the DJI price increases over time so does the average range of each candle so you are far more likely to stay in tune with the market as it moves forward.
As ever I am sceptical of the 5 minute time frame due to the lack of backtest data available. I only have 100k bars so let’s hope someone with 200k can come along and give us an OOS test.
08/20/2018 at 9:27 PM #78683much better to set them with a percentage rather than a fixed pip amount
Thanks, I agree with the logic, but I have more of a memory / feel for fixed pips that I am happy with for the various TF’s (from manual trading I guess).
If I were running Live with a System I would hope I’d periodically reassess; I’m sure I’d be watching it like a hawk!!! 🙂
08/21/2018 at 9:39 AM #78687As ever I am sceptical of the 5 minute time frame
Well you’re going to hate this one then! 🙂 🙂
I’ve got 4 versions on Demo Fwd Test now!
Multi TF on this version and max Lot size of 2.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162//-------------------------------------------------------------------------// Main code : Mags/Nic BO DJI 5M v1.1//-------------------------------------------------------------------------//https://www.prorealcode.com/topic/translation-of-easylanguage-code/defparam cumulateorders=false//Main Timeframe: 15-minute (EXCHANGE TIME) Second Timeframe: DAILY//{Strategy inputs}//inputs:Timeframe (5 mn, updateonclose)myFraction=4.7N1higher=10N2higher=16N1main=4EntryCond1long=1 //(0=false ; 1=true)EntryCond2long=1 //(0=false ; 1=true)//{StopLoss}//Input:if onmarket thenalreadytraded=1endifif intradaybarindex=0 thenalreadytraded=0endif//Point Of InitiationTodaysOpen = DOpen(0)//For the calculation of the spaceATR = AverageTrueRange[40]//The BreakoutLevel (POI + space)myBreakoutLong = TodaysOpen + ( myFraction * ATR )//higher timeframe filter condition (DAILY)EntryCond1long = 0.1 * (Dclose(0) - DHigh(N1higher)) < N2higher//main timeframe filter condition (15 minute)EntryCond2long = dClose(1) - Lowest[N1main](high) < ATR//Position size conditionif dclose(1) < dopen(1) thenvalue1 = 2ElseValue1 = 2endif//Entry Conditionif not onmarket and EntryCond1long and EntryCond2long and not alreadytraded thenbuy value1 contracts at myBreakoutLong stopendif//Exit ConditionTimeframe (1 mn)If Stochastic[14,3](close) crosses under 90 ThenSell at MarketendifSET TARGET PPROFIT 90set stop ploss 901 user thanked author for this post.
08/21/2018 at 10:17 AM #78693Well you’re going to hate this one then!
1 minute time frame = 25 x more sceptical than 5 minute time frame!
08/22/2018 at 8:51 AM #78740Anybody any ideas what may be causing the error message attached for the code 2 posts up.
https://www.prorealcode.com/topic/translation-of-easylanguage-code/page/2/#post-78687
Below is the only addition to a version of the code which is running fine, so the error message seems not to make sense??
1234Timeframe (1 mn)If Stochastic[14,3](close) crosses under 90 ThenSell at MarketendifEdit / PS
I just noticed I’d set it going on 5 min TF and it should be 1 min, corrected now, but I’ll leave the post up as the error message seems a weird anyway and may be relevant re MTF beta testing etc.
08/22/2018 at 9:09 AM #78743Edit / PS I just noticed I’d set it going on 5 min TF and it should be 1 min, corrected now, but I’ll leave the post up as the error message seems a weird anyway and may be relevant re MTF beta testing etc.
Coffee hadn’t worked thro’ … v2.1 was running on 1 min TF after all!
It had 5M in the System name that’s where I was confusing myself! 🙂
So the weird error message (see post above) still stands as a query if any ideas from anybody please??
Edit / PS
Also the rejection occurred 2 or 3 times per second over a 10 second period (see attached to above post).
08/22/2018 at 9:12 AM #78745That just looks like the order has been rejected because the strategy is trying to place it on the market at a price that has already been passed. There is only one pending order in the code on line 52 so the calculated value of myBreakoutLong must be wrong sometimes. Try graphing it and the close price and see what values you get.
1 user thanked author for this post.
08/22/2018 at 9:35 AM #78748Spot on Vonasi!
Thank you and a double thank you for thinking even while 25 x sceptical! 🙂
First image is at time of error message (price below myBreakoutLong) and second image is a successfull trade being placed (price above myBreakoutLong).
Any ideas for a fix (or anyone else) please? (Full code is 6 posts above)
08/22/2018 at 9:54 AM #78753You could just put in an extra condition that means you only try to place an order if myBreakoutLong is greater than close. That way you will not get any rejected orders.
You could also try just buying at market if myBreakoutLong is lower than close – or set a LIMIT order if it is lower and a STOP order if it is higher.
I’ve not looked at the strategy details so not sure how the above would change results.
08/22/2018 at 9:57 AM #7875408/22/2018 at 10:09 AM #78756A buy STOP order is one to buy at a worse price than the current one so you would need to only place the order if myBreakoutLong is higher (a worse price to buy) than close. So you need:
1c1 = myBreakoutLong > closeEdit: You edited your post again!
08/22/2018 at 10:27 AM #78757Edit: You edited your post again!
Yes I know, sorry! Thanks for clarification!
I realised I had it wrong as only half my brain is on this, but I’m also trying to order scaffolding for my daughters extension! 🙂
08/22/2018 at 10:41 AM #78761c1 = myBreakoutLong > close
What is confusing me though is that when the System got rejected with the weird error message then myBreakoutLong > close.
I guess my screen shot below is a red herring ?
08/22/2018 at 10:51 AM #78766I’ve got it now … all conditions are met at close of bar (including myBreakoutLong > close) and then if the pending order – stop level (mybreakoutLong) – is met in the next bar then a trade is executed.
Still don’t understand exactly why I got the original error message though?
08/22/2018 at 11:06 AM #78770but I’m also trying to order scaffolding for my daughters extension!
That’s nice that you are having your daughter extended!
1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on