Average cross with Opt

Forums ProRealTime English forum ProScreener support Average cross with Opt

Tagged: 

Viewing 12 posts - 1 through 12 (of 12 total)
  • #170021

    Hi All,

    Can any of you advice me how to code the following things in an average cross with optimization?

    1. Buy / Sell on the same bar where the cross happens
    2. Trade always with the 100% of available Equity
    3. No delay in opening orders.

    Thanks in advance!

    #170055

    1. strategies are executed when a candle closes, so any trade is entered just a few microseconds before the new candle opens

    2. can you post an example or more details, please?

    3. (same as 1.)

    To overcome points 1 and 2, MTF (Multi Time Frame) support can be used so that you can earlier see what happens on the higher TF from a lower one.

     

    #170701

    Thank you Roberto for your answer.
    What I meant by “Trade always with the 100% of available Equity” is that I want to always make orders with the available capital, not with the Initial one (reinvesting gains)

    This is what I am using, do you see any error that makes my EMA cross not accurate?
    Thanks!

    #170705

    There are some errors:
    1. in line 6 you are referencing the previous candle using [1], so I removed it for the current candle
    2. in line 12 you used the same indicator for the cross under, so I changed it.

    As to lot management, I added a calculation which is based on three parameters I added after DEFPARAM:
    1. starting capital (you have to write the capital you plan to use when the strategy starts)
    2. the minimum lot size allowed by the broker (or any greater value that suits you best)
    3. the number of lots that you usually trade with the starting capital (you will set the number according to
    your preferences about risk, drawdown, margin, etc…) then the calculations that follow will adjust it
    to your profits/losses.

    #170997

    Thank Roberto! I appreciate your help on this and I understand your corrections.

    Im trying to replicate what you created, but for any reason that I cannot spot, the line 8 got error ” Close the line”

    Do you know where this could come from?
    Thanks!

    #171005

    Unless you did a wrong Copy & Paste the only solution could be to either:

    • comment out line 2
    • remove or comment out + StrategyProfit from line 7

    in both cases there is a conflict between your intention to reinvest gains and line 2.

    I never used line 2.

    If the error is still reported you should post your code.

     

    #171006

    I have commented out line 2, and I have also tried removing + + StrategyProfit from line 7, and I still have the error.

    Please find attached the error message, I think is something simple but I cannot spot it.

    Thanks!

    #171008

    Ok, I see, sorry my fault.

    LOTS is a reserved keyword. Replace any occurrence of that word with MyLots, or any one else that you wish.

    But I think you should also comment out line 2, as it may affect STRATEGYPROFIT.

     

    #171113

    Thank you Roberto,

    I have emailed you.

    Thanks!

    #171124

    Hi Roberto,

    I have tried your system following all your instructions, but It does not give me any result..All values in 0.

    Any idea where the issue comes from? see attached screenshots

    #171132

    Letme know:

    • the security you tested it on
    • the TF used
    • the number of units.

    Please also post your ITF file.

    #171154
    • the security you tested it on—> GOOGL
    • the TF used—>daily
    • the number of units.–> 500 & 1000

    Please also post your ITF file.—> attached

Viewing 12 posts - 1 through 12 (of 12 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login