Reset Tradeindex each day?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #27262 quote
    DavidB
    Participant
    Junior

    Hi new to coding can you help me with the the tradeIndex. I want to re set it to to nil at the start of ever trading day for back testing.  David

    #27265 quote
    Nicolas
    Keymaster
    Master

    Tradeindex is a built-in instruction, it cannot be reset like a variable.
    What do you want to do exactly?

    #27281 quote
    DavidB
    Participant
    Junior

    I want to enter the market by a moving average crossing and then set a limit for that trade say 30 points but if the moving average then crosses latter

    the same trading day I only want to take the one trade per day.

    “IF NOT LongOnMarket AND Time > startime AND c2 AND TRADEINDEX < 1 THEN
    BUY 10 PERPOINT AT MARKET ”

    c2 = the moving average cross and i am using it on a minute time frame so getting many crossing during the day . The above is only taking the one trade per day but when you go to back test it only shows the first trade on the first day of the test.

    David

    #27289 quote
    Nicolas
    Keymaster
    Master

    It’s a common question here on forum, please find below some links that will help you code it:

    https://www.prorealcode.com/topic/how-to-operate-just-once-in-a-day/

    https://www.prorealcode.com/topic/only-one-trade-per-day-on-3-strategies/

    https://www.prorealcode.com/topic/ein-trade-pro-tag/

    etc. You might find some extra links too by using the Search feature of the website.

    #27309 quote
    DavidB
    Participant
    Junior

    Many thanks very helpful Nicolas.

    #27600 quote
    DavidB
    Participant
    Junior

    only one trade per day on 3 strategies

    Thanks used the code from above and able to back test and only taking one trade per day.

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

Reset Tradeindex each day?


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
DavidB @davidb Participant
Summary

This topic contains 5 replies,
has 2 voices, and was last updated by DavidB
9 years ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 03/05/2017
Status: Active
Attachments: No files
Logo Logo
Loading...