Identify candle direction

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #110839 quote
    pablojmlpablojml
    Participant
    New

    Hello forum,

    I’m new at this with no coding experience, I’m trying to sort out the code for the simple logic below. Could someone help with this?

    1. Is close of the candle for a 30m or 15min period above or below open
    2. If above, then place a buy order for x amount with a specific SL and Limit
    3. If below, then place a sell order for x amount with a specific SL and Limit

    Much appreciated!

    Regards,

    Pablo.

    #110840 quote
    VonasiVonasi
    Moderator
    Master

    pablojml – Your question is strategy related. The place for strategy questions is the ProOrder forum and not the PrScreener forum. I will move your post to the correct forum.

    Please post in the correct forum with future posts.

    #110856 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    There you go:

    Offfset = 20 * pipsize
    IF close > open THEN
       BUY 1 CONTRACT AT close + Offset STOP
    ELSIF close < open THEN
       SELLSHORT 1 CONTRACT AT close - Offset STOP
    ENDIF
    SET TARGET PPROFITO 50
    SET STOP   PLOSS    50
    #110894 quote
    pablojmlpablojml
    Participant
    New

    Thanks Roberto,

    I’m struggling to understand what the offset does in this code. And what is the difference between these two:

    Buy 1 CONTRACTS AT MARKET
    
    Buy 1 CONTRACTS AT close

    If the code is testing if opening is above or below close, then “AT MARKET” should do the trick no? as it will be comparing precisely at close and buying/selling at the start of the next candle.

    Also, forgot to add if I wanted to test 1 specific candle of the day at one specific hour, how can I add this to the code?

    Regards,

    Pablo.

    #110896 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Offset is what you meant by X, a displacement or distance from the price.

    Otherwise what amount was your X?

    As for the time:

    IF time = 090000 THEN
      .
      .  //here you need to put all the code you want to be executed at the desired time
      .
    ENDIF
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Identify candle direction


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
pablojml @pablojml Participant
Summary

This topic contains 4 replies,
has 3 voices, and was last updated by robertogozzirobertogozzi
6 years, 11 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 10/22/2019
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...