System to not enter trade on specific happenings like NFP

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #81963 quote
    Abz
    Participant
    Veteran

    Hello

    is there any way to tell the strategies to not enter any trade on  U.S. Nonfarm Payrolls this seems to occur first friday in every month.

     

    #81965 quote
    robertogozzi
    Moderator
    Master
    IF OpenDay < 8 AND OpenDayOfWeek = 5 THEN
       TradeOn = 0
    ELSE
       TradeOn = 1
    ENDIF

    From 1st through 7th each month there is just ONE friday, in that case the variable TRADEON will be cleared, set otherwise.

    You have to add TradeOn to your conditions to open any trade.

    This snippet works for intraday bars.

    Abz thanked this post
    #81967 quote
    Abz
    Participant
    Veteran

    worked perfectly 🙂

    #81972 quote
    noisette
    Participant
    Veteran

    Hello,

    I have also this kind of question.

    Do you think it is possible to use CALL fonction to create a “remote control” of the code?

    My idea is to modify the called indicator to say to indicate days on and day off. But I don’t know if  a bot can’t take in account indicator modification. I didn’t test it.

     

    Thanks

    #81997 quote
    robertogozzi
    Moderator
    Master

    I tried this simple strategy with the indicator:

    //-------------------------------------------------------------------------
    // Codice principale : Il Mio Sistema-XXX
    //-------------------------------------------------------------------------
    defparam cumulateorders=false
    if OnMarket THEN
       SELL AT MARKET
    endif
    Cond = CALL "TradeOrNot"
    IF Cond THEN
       BUY AT MARKET
    ENDIF
    
    
    //-------------------------------------------------------------------------
    // Funzione : TradeOrNot
    //-------------------------------------------------------------------------
    RETURN 0    //1=trade ON       0=trade OFF

    My idea was to change the indicator, setting it either to 0 or 1 to allow/ban trading, but it seems indicators are now being embedded at launch time and used like regular functions in programming languages (this feature will make code faster and was long awaited) but you will have to stop your strategy and restart it from scratch after modifying the indicator, so it’s no use. You’ll have to modify dates embedded in your strategy.

    As far as I know there are no alternatives, can @nicolas confirm indicators are now embedded in the strategy?

    #82026 quote
    noisette
    Participant
    Veteran

    Thank you for the test, that’s exactly what I think about.

    It would be interesting to do this another way for codes that need a learning period as neural networks.

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

System to not enter trade on specific happenings like NFP


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Abz @abbas_sadiq Participant
Summary

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

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