orders placed on the FTSE after the first 15 minute candle is formed at the open

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

    Hi I am new to coding and just started learning. I was hoping someone could help me with a simple code to help me learn how it is structured.

    Two orders placed on the FTSE after the first 15 minute candle is formed at the open.

    One long order + 1 point above the high of the 15 minute candle.

    One Short order -1 point below the low of the 15 minute candle.

    £3 per point on both

    Once one order is triggered the other order is deleted.

    Limit 45 points

    Stop 20 points

    After the price has moved 25 points stop loss moves to breakeven/ open price.

    If any one could help me with this it would be much appreciated.

    Thank you in advance.

    Chris

    #197512 quote
    Nicolas
    Keymaster
    Master

    Your title was not meaningful (“assistance for a code..”), it doesn’t help people to find relevant topic in the future. Please respect the posting rules detailed below in the yellow box.

    #197513 quote
    Flair15
    Participant
    New

    Sorry I’m new I will make sure I make the title relevant in the future.

    #197583 quote
    robertogozzi
    Moderator
    Master

    There you go:

    DEFPARAM CumulateOrders = true
    ONCE LongEntry  = 0
    ONCE ShortEntry = 0
    IF Not OnMarket THEN
       MyProfit = 0
    ENDIF
    IF Time = 090000 THEN   //must be set to the TIME the first 15-minute candle candle closes
       LongEntry  = high + 1*PipSize
       ShortEntry = low  - 1*PipSize
    ENDIF
    IF LongTriggered OR ShortTriggered  THEN
       LongEntry  = 0
       ShortEntry = 0
    ENDIF
    IF LongEntry > 0 THEN
       BUY       3 Contract AT high + 1*PipSize STOP
       SET TARGET pPROFIT 45
       SET STOP   pLOSS   20
    ENDIF
    IF ShortEntry > 0 THEN
       SELLSHORT 3 Contract AT low  - 1*PipSize STOP
       SET TARGET pPROFIT 45
       SET STOP   pLOSS   20
    ENDIF
    IF OnMarket AND MyProfit < 25 THEN
       MyProfit = PositionPrice * PositionPerf / PipSize
       IF MyProfit >= 25 THEN
          Set Stop Breakeven
       ENDIF
    ENDIF
    #197584 quote
    Flair15
    Participant
    New

    Roberto your a star thank you ever so much.

    robertogozzi thanked this post
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

orders placed on the FTSE after the first 15 minute candle is formed at the open


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Flair15 @flair15 Participant
Summary

This topic contains 4 replies,
has 3 voices, and was last updated by Flair15
3 years, 7 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 07/19/2022
Status: Active
Attachments: No files
Logo Logo
Loading...