Target profit does not work

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #110647 quote
    LouRichard
    Participant
    Veteran

    Hello,

    I use the following code but the target profit does not work I don’t understand why

    itarget = fibo0+irange*1.618
    istop = fibo0-2*pointsize
    
    buy n contract at market
    
    set stop loss istop
    set target profit itarget
    
    graph itarget as "itarget buy"

     

    #110650 quote
    Vonasi
    Moderator
    Master

    LouRichard – Please always use the ‘Insert PRT Code’ button when posting code as it makes it much easier for others to read. I will tidy up your post for you! 🙂

    #110651 quote
    Vonasi
    Moderator
    Master

    Without knowing what the values of fibo0 and irange are it is impossible to say but at a guess I would say you are probably calculating a price to sell at rather than a distance to sell at. SET STOP and SET TARGET require a distance in pips (or a distance in percentage if using %LOSS and %TARGET).

    #110653 quote
    LouRichard
    Participant
    Veteran

    Hello Vonasi,

    Thanks for your reply and the mod on my code.

    Ok I understand my error it is because I try to sell at a value and not a distance

    Thanks

    #110660 quote
    Vonasi
    Moderator
    Master

    What a guess! 🙂

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

Target profit does not work


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
LouRichard @lourichard Participant
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by Vonasi
6 years, 4 months ago.

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