Sorex hoyi scalper
Forums › ProRealTime English forum › ProOrder support › Sorex hoyi scalper
- This topic has 29 replies, 6 voices, and was last updated 4 years ago by MAKSIDE.
-
-
04/14/2020 at 3:36 PM #126111
if barindex>1 and range>0 then 1 if barindex>1 and range>0 then and/or when there’s possibly no data i.e. the max function max(abs(open – close), 0.000000001) 1 max(abs(open – close), 0.000000001) can also be used on an average I think, like max(ExponentialAverage[20](close),0.000000001) 1 max(ExponentialAverage[20](close),0.000000001) I don’t now where exactly is the cause, so in the renko version I use above a lot.
@Paul – thanks for this info. Where do I enter this in the code?I tried to figure it out by searching the forum but can’t seem to get it right.
04/14/2020 at 3:43 PM #126113Has anybody tried a fix on the code below (as in something similar to what Paul offered)?
Reason: if there is no volume then we will get ‘divide by zero’ errors?
1VWAP = SUMMATION[d](volume*typicalprice)/SUMMATION[d](volume)How about …
1VWAP = SUMMATION[d](volume*typicalprice)/(max(SUMMATION[d](volume),1)OR
1VWAP = (MAX(SUMMATION[d](volume*typicalprice)/SUMMATION[d](volume)),typicalprice)OR
….
04/14/2020 at 4:02 PM #12611804/14/2020 at 4:04 PM #126119as there isn’t volume on CFD account
There is volume on Indexes and Shares just not on Forex.
04/14/2020 at 4:08 PM #12612004/14/2020 at 4:20 PM #126122i just see it’s the code of the VWAP..
The VWAP can only be calculated for markets like those of futures which publish their order volume. TWAP is an identical concept but can be used for instruments such as CFDs or Forex, the volumes of which are not available.
04/14/2020 at 4:22 PM #12612304/14/2020 at 4:23 PM #12612404/14/2020 at 4:27 PM #126125I actually removed the VWAP part of the code as it wasn’t necessary. I still can’t make it work with demo forwardtesting due to the division by zero issue though.
check all your divisions, there is necessarily a division in your code which is problematic
04/14/2020 at 5:13 PM #12613004/14/2020 at 5:23 PM #126132That’s what I’m trying to do – yet I haven’t figured which part it is. I did however launch a pre-Paul version and it hasn’t yet done a trade but it hasn’t given me an error since I launched it 21 minutes ago – normally the error message comes up shortly after it goes live. I believe the division error must be part of the code Paul added — will post the solution when I figure it out.
04/14/2020 at 5:35 PM #12613304/15/2020 at 8:24 AM #126202i just have an question about the spreadmode
why do you divide the spread by 2 after the determination of it ?
//
In order to have a backtest which works during all the time, it would be great if IG could transmit to PRT through an API the history of the average spread used per date time slot every day and then, get the spread/date time slot coming from PRT variables in order to to use them in backtest.
04/15/2020 at 1:28 PM #126273@makside; if you use spread 6 on dji and look at a price, you see a difference of 3 points with spread and without spread for either side. (i.e. index=23850, long pays 23853, short pays 23847)
i.e. long position when spread is high, stoploss 50points, pt 50 points, spread 6 backtest
23850, spread 6/2=3 backtest paid 23853, stoploss 23803 and profittarget 23903
with spreadmode on = more similar to live.
23850, spread14/2=7 backtest paid 23857, stoploss at 23807 and profittarget at 23907.
The most annoying thing is when live account reaches stoploss but not the backtest, or that backtest reached profittarget but not the live account or when the trailingstop kicks in. So somehow it’s better run an optimisation that uses an entryprice more closely to the real trading in 24h setup.
I agree with you. It was an effort to reduce differences backtest & live, much better would be what you suggested.
1 user thanked author for this post.
04/15/2020 at 1:39 PM #126274 -
AuthorPosts
Find exclusive trading pro-tools on