missing code for closing order @ next bar open

Forums ProRealTime English forum ProOrder support missing code for closing order @ next bar open

Viewing 10 posts - 1 through 10 (of 10 total)
  • #78080

    Hi together,

    I’d like to close a position at the open of the next bar. As i found out nextbaropen can not be used to close positions. Am I right?

    Perhaps somebody can help me with the snippet.

     

    #78081

    All you need is:

     

    1 user thanked author for this post.
    #78088

    Here is the amended code…

    It’s ony working for long positions. Short didn’t work well.

    For C =  0,43 worked best

    #78099

    When you say ‘Short didn’t work well’ you mean the strategy not the code.

    If you look at the Wall Street chart then only a fool would try to short it! The trend is your friend! That is your first edge!

    #78100

    // Conditions to exit long and short positions

    Enter short keyword is SellShort

    Exit short keyword is ExiShort

    Do you need above to get your code working because in the Marc version code you have no SellShort??  (Vonasi version code does have SellShort / ExitShort).

     

    #78102

    I think GraHal that he means that he has removed the short side of the strategy because it does not work on the DJI. Which is not surprising if you look at the DJI chart – low on the left and high on the right and virtually a straight line in between!

    1 user thanked author for this post.
    #78104

    Hi GraHal,

     

    I forgot to delete or amend the phrase after //.

    This strategy currently works only for long positions and doesn’t allow short positions…

    1 user thanked author for this post.
    #78105

    This system shall refer a litle bit to Andrea Unger’s pattern strategy. The biggest difference is that the rules for this strategy here enters market orders and not orders at high or low…

    Perhaps I will add a MA for trend direction

    #78148

    Hi together,

    I have a suggestion regarding this system…perhaps somebody can help me amending this code.

    I thought about following thing.
    Each day I have a reference candle for example at 8 o’clock.
    I enter a long trade (either at market or as High Stop order) when close of a following candle is above open of reference candle and range of High and Low is bigger compared with Open and Close (bigger than variable factor)
    I enter a short trade (either at market or as Low Stop order) when close of a following candle is below open of reference candle and range of High and Low is bigger compared with Open and Close (bigger than variable factor)

    Exit shall be at open of next bar Open or Close of current bar after order was placed.

     

    Can anybody help me?

     

    Thank you in advance

    Marc

    #78371

    Hi Marc, I think that it could be a good idea to learn to code a bit. What you request is easy to add to your strategy.

    Learn to program for ProRealTime

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

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