how to code MFE exit

Viewing 4 posts - 16 through 19 (of 19 total)
  • Author
    Posts
  • #157626 quote
    Monobrow
    Participant
    Senior

    like this the correct/best way to do it?

     

    MFE = MAX(1,summation[barindex-tradeindex](positionperf > 0))
    IF shortonmarket and barindex-tradeindex > 24 and MFE <= 6 then
    Exitshort at market
    Buy 5 perpoint at market
    endif
    #157647 quote
    Monobrow
    Participant
    Senior

    To add…. Im not sure it is anything to do with the entry/exit as the error happens on the 3rd bar. so no where near when it should be reversing.

    ive attached the screenshots of when it quit – 0920

    also current MFE value is 1

    current positionperf is -0.00119

     

    any ideas appreciated as this change is a +25% increase to algo. again no issues in backtest, just on Live, IG, DAX 1MIN DFB

    negative-error.jpg negative-error.jpg
    #157696 quote
    Dow Jones
    Participant
    Veteran

    Try add check that barindex – tradeindex > 0

    Back test not reliable on this matter as it cannot detect division by zero so I’m not surprise if it cannot detect summation with negative value too

    Monobrow thanked this post
    #157699 quote
    Monobrow
    Participant
    Senior

    Thanks DJ, i’ll try that.

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

how to code MFE exit


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 18 replies,
has 6 voices, and was last updated by Monobrow
5 years, 1 month ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 01/06/2021
Status: Active
Attachments: 2 files
Logo Logo
Loading...