Sorex hoyi scalper

Viewing 15 posts - 16 through 30 (of 30 total)
  • Author
    Posts
  • #126111 quote
    eckaw
    Participant
    Veteran

    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.

    #126113 quote
    GraHal
    Participant
    Master

    Has 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?

    VWAP = SUMMATION[d](volume*typicalprice)/SUMMATION[d](volume)

    How about …

    VWAP = SUMMATION[d](volume*typicalprice)/(max(SUMMATION[d](volume),1)

    OR

    VWAP = (MAX(SUMMATION[d](volume*typicalprice)/SUMMATION[d](volume)),typicalprice)

    OR

    ….

    #126118 quote
    MAKSIDE
    Participant
    Veteran

    the second for me 😉

    just a question, as there isn’t volume on CFD account but only on Future, i always have doubts about the valuation on the volume used on cfd.. and thus, the strategy. do you agree ?

    #126119 quote
    GraHal
    Participant
    Master

    as there isn’t volume on CFD account

    There is volume on Indexes and Shares just not on Forex.

    #126120 quote
    MAKSIDE
    Participant
    Veteran

    i understand that the volume on CFD have no interest.. it’s not the volume on limited cfd that have an impact on the market

    #126122 quote
    MAKSIDE
    Participant
    Veteran

    i 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. 

    #126123 quote
    eckaw
    Participant
    Veteran

    I 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.

    #126124 quote
    MAKSIDE
    Participant
    Veteran
    #126125 quote
    MAKSIDE
    Participant
    Veteran

    I 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

    #126130 quote
    GraHal
    Participant
    Master

    Or bars with no data?

    Or NO bars at all at times?

    Or Close = Open

    Or some other weird occurence? 🙂

    You could // out single  lines a time until you find which line is causing the divide by zero Issue?

    #126132 quote
    eckaw
    Participant
    Veteran

    That’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.

    GraHal and swedshare thanked this post
    #126133 quote
    Paul
    Participant
    Master

    @eckaw I hope you figure it out.  an other strategy also came to a stop despite the changes, but it happens less frequently.

    eckaw thanked this post
    #126202 quote
    MAKSIDE
    Participant
    Veteran

    i 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.

    #126273 quote
    Paul
    Participant
    Master

    @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.

    MAKSIDE thanked this post
    #126274 quote
    MAKSIDE
    Participant
    Veteran

    @Paul

    thx for your explanation.. nothing in simple 🙁

Viewing 15 posts - 16 through 30 (of 30 total)
  • You must be logged in to reply to this topic.

Sorex hoyi scalper


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
eckaw @eckaw Participant
Summary

This topic contains 29 replies,
has 6 voices, and was last updated by MAKSIDE
5 years, 10 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 04/12/2020
Status: Active
Attachments: 7 files
Logo Logo
Loading...