Stoploss not put in place

Viewing 7 posts - 31 through 37 (of 37 total)
  • Author
    Posts
  • #225817 quote
    ashehzi
    Participant
    Average

    Thanks @GraHal.

    I can give it a try by removing NOT LONGONMARKET/SHORTONMARKET/ONMARKET to see the behaviour as I don’t take more than one trade at a time on this system. I’ve already in place Defparam CumulateOrders = False.

    @PeterSt, sure, I’ve attached with all columns included. The issue is not that. You can clearly see 3 rows for 1h algo and 2 rows for 30mins. The issue I was explaining earlier was that not all stops and limits are being placed. I cannot go lower than 30 mins timeframe for this algo because of limitation of 10k for PRELOADBARS. I would 15m action with PRELOADBARS supporting 20/30k but it is what it is. I understand more PRELOADBARS means bigger memory footprint for the program on PRT servers but why not? I wonder what was the other logic to limit PRELOADBARS to 10k.

    GraHal thanked this post
    dax_29dec23_final.png dax_29dec23_final.png
    #225821 quote
    JS
    Participant
    Senior

    You say you can’t take a higher time frame than 30 minutes with the maximum PreLoadBars (10,000)…

    So, you use an algo/indicator that looks back about 1 year (10,000*30min) in history…?

    #225826 quote
    ashehzi
    Participant
    Average
    Yes it is quite obvious. Different algos different methods, some run on short tf, some on higher. If you want to use higher timeframe averages or similar, then you need longer time frame data. Lesser trades but greater reward.
    #225829 quote
    JS
    Participant
    Senior

    Yes, that’s clear… only an Average[10000](Close) (or similar) on a 30 minute time frame is a bit more unusual…but indeed possible…

    #225969 quote
    ashehzi
    Participant
    Average
    For the initial issue of no stop loss / target profit set, I think I might have found the issue.
    IF NOT LONGONMARKET AND LongCondition THEN
    BUY 1.0 CONTRACTS AT myLevel limit
    SET TARGET PLOSS lossDistance
    SET TARGET PPROFIT profDistance
    ENDIF
    For the algo using above code, I’ve following setting in place:
    1. Max Position: 1 Amount/Pt
    2. Guaranteed stop: No
    3. Readjust stops: Yes
    In my open positions window, I noticed the following (see attached): Under limit, it was showing Caution symbol and related info was:
    1. Current Position: 1
    2. Total qty of targets: -2
    3. Total qty of stop loss: 0
    The total quantity of your target orders exceeds your position if executed, these orders could lead to opening a new position n opposite direction. Now, I am wondering, if I change “SET TARGET PLOSS lossDistance” to “SET STOP PLOSS lossDistance”, will it resolve the issue completely? What am I missing here?
    nas100_2024_nostop_why1.jpg.png nas100_2024_nostop_why1.jpg.png
    #225972 quote
    GraHal
    Participant
    Master
    But those who are nevertheless tempted to use a set target loss statement, should NEVER launch it simultaneously with the order entry (buy, sellshort), be it at market or pending. This one is meant to be launched once in real trouble, when loss is already BIGGER than the distance supplied with the set target loss.
    ashehzi you are doing what it says NOT to do in bold in above text.
    if I change “SET TARGET PLOSS lossDistance” to “SET STOP PLOSS lossDistance”, will it resolve the issue completely?
    Yes try above and let us know.
    ashehzi thanked this post
    #225974 quote
    ashehzi
    Participant
    Average
    Yes that is old code and was still running on one of the demos, found the issue and thought to share for the benefit of others. I’ve mostly changed the code to set stop.
    GraHal thanked this post
Viewing 7 posts - 31 through 37 (of 37 total)
  • You must be logged in to reply to this topic.

Stoploss not put in place


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
ashehzi @ashehzi Participant
Summary

This topic contains 36 replies,
has 8 voices, and was last updated by ashehzi
2 years, 1 month ago.

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