Multi timeframe scalp code question

Forums ProRealTime English forum ProOrder support Multi timeframe scalp code question

Viewing 7 posts - 1 through 7 (of 7 total)
  • #85933

    Hi. I want to create a simple program for automatic trading that creates small scalping trades using 15 minute and 5 minute charts (5 minute is the default).

    I am experimenting with different conditions to open the trade but as an example lets say this is a long trade and the opening condition is that MACDline (12,26,9) crosses over 50 on the 5 minute chart. And the RSI(14) must be below 50 on the 15 minute chart

    On the 15 minute chart I have created 2 bands using the ATR. The upper band is the close + the ATR(14) and the lower band is the close – the ATR(14).

    When the trade is opened on the close of the 5 minute bar I want the profit target to be the upper ATR band on the 15 minute chart at the time the trade is opened, and the stop loss to be the lower ATR band on the 15 minute chart at the time the trade is opened.

    Can you help me to code this please?

    #85934

    Your question is ProOrder related and not a platform support issue so I have moved your post. Posting in the correct forum will have the best chance of getting a solution and will save us moderators a lot of time moving posts around all day!

    Please try to post in the correct forum with future posts. 🙂

    #85943

    You mean MACDline (12,26,9) crosses over 0 ?

    #85982

    Sorry yes you are right!

    #86036

    This the code:

    When computing SL and TP I used ABS(()  to make sure it’s not a negative number, because UPDATEONCLOSE at line 1 makes TF15 values older than TF5 so a sudden surge on the default TF might cause, even temporarily, a closing price higher/lower than it was when TF15 closed.

    If you remove UPDATEONCLOSE then you can also remove ABS() but values on TF15 will be the current ones when the TF5 closes, not when TF15 closed last time.

    If you want to try you can even launch the strategy from a 3-minute or 1-minute TF, since 15 is a multiple of 5, 3 and 1 (not 2).

    2 users thanked author for this post.
    #86076

    Even I can understand this one! 🙂  Thank you Paulon and Roberto.

    Results attached for 1 Hour and 3 mins default otherwise unchanged from Roberto code above.

    #86144

    Version 1.4 with Shorts.

    If you improve then please post on here so we can all share.

     

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

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