Strategy stopped working since update

If you need an Indicator or Signal developed or translated from other language, please post all Indicator development REQUESTS to this section here.

Moderator: admin

Strategy stopped working since update

Postby robbieyoung » Fri Jun 09, 2023 2:41 am

The attached strategy uses long time frames and has worked consistently for a long time now.

Since a recent update to Trading Station the strategy no longer works.

I was previously advised that to use longer timeframes you had to include the helper file:
"dofile(core.app_path() .. "\\strategies\\standard\\include\\helper.lua")"

Please advise or help me fix the strategy so that it works on the newly updated Trading station.

Thanks for any help you can give.
Attachments
H4 EURUSD 10U 1000.lua
(21.14 KiB) Downloaded 40 times
robbieyoung
 
Posts: 32
Joined: Tue Apr 21, 2015 3:12 am

Re: Strategy stopped working since update

Postby Apprentice » Thu Jun 15, 2023 5:26 am

We have added your request to the development list.
Development reference 526.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36495
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia


Re: Strategy stopped working since update

Postby robbieyoung » Tue Jul 11, 2023 9:23 am

Apprentice,

I have tried backtesting with the strategy provided but it doesn't seem to create any trades.

Would there be any benefit in paying for this to be recoded this from scratch?

Would it be simplified/more efficient etc and would this make updating the code to keep up with TS changes easier?

Thanks,

Robbie
robbieyoung
 
Posts: 32
Joined: Tue Apr 21, 2015 3:12 am


Re: Strategy stopped working since update

Postby robbieyoung » Mon Jul 17, 2023 5:01 am

Strategy Rules:

1 - Specify whether Buy or Sell or Both is the first allowed side when first starting the strategy - this is to prevent the strategy from starting in the middle of a Buy/Sell phase instead of at the beginning.

2 - Specify the maximum balance (not equity) to date and the %age of this maximum balance to use to determine the size of the trade (T) - maximum balance figure would be updated if a higher maximum balance was attained during a trading session.

3 - The strategy would use either of following 2 logics : (so may require 2 separate strategy files)

Fast SMA crosses above the slow SMA, close sell trade (if open) and open a buy trade of size T.
Fast SMA crosses below the slow SMA, close buy trade (if open) and open a sell trade of size T.
Both SMAs would need to handle values which range from MA(1) to MA(1600).

Or

When the SMA moves up X times, close sell trade (if open) and open a buy trade of size T.
When the SMA moves down X times, close buy trade (if open) and open a sell trade of size T.
The SMA would need to handle values which range from MA(1) to MA(1600).
The number of X times would need to range from moving up or down 1 time to 124 times.

The current strategy I have been using may have been built initially with FXStrategyWizard and then recoded by someone else so I would love this to be simplified if at all possible.

I currently copy the code to excel and use excel to code the logic relating to the MA moving up X times as this becomes very large when you get up to 124 times.

Thanks for any help that you might give,

Robbie
robbieyoung
 
Posts: 32
Joined: Tue Apr 21, 2015 3:12 am

Re: Strategy stopped working since update

Postby robbieyoung » Mon Jul 17, 2023 1:02 pm

Apprentice,

Additionally, I managed to put together the attached code which may or may not help in coding this Strategy.

The code is not yet a proper strategy as recognised by TS/Indiocre but contains LUA code for some/all of the logic.

What more needs to be added to this to make it a recognised strategy or is it better to completely rewrite from scratch?

Thanks for any help you might give,

Robbie
Attachments
New Code.Lua
(4.79 KiB) Downloaded 30 times
robbieyoung
 
Posts: 32
Joined: Tue Apr 21, 2015 3:12 am

Re: Strategy stopped working since update

Postby Apprentice » Thu Jul 20, 2023 2:07 pm

We have added your request to the development list.
Development reference 623.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36495
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Strategy stopped working since update

Postby robbieyoung » Mon Jul 24, 2023 3:49 pm

Apprentice,

I believe I have managed to solve this.

I will post the code once I have completed testing.

Robbie
robbieyoung
 
Posts: 32
Joined: Tue Apr 21, 2015 3:12 am

Re: Strategy stopped working since update

Postby robbieyoung » Tue Jul 25, 2023 8:56 am

Apprentice,

Attached is the code I have created.

The code works when tested in backtester with all trades being placed at the correct time.

However when I try and use this code live the no trades are opened.

I suspect there is an issue with the TradeSize variable but despite numerous attempts I have not been able to correct it.

As this is my first attempt at coding in lua please could you attempt to fix the code such that trades are opened when they are supposed to.

Thanks for any help you might give,

Robbie
Attachments
H4 EURUSD 5U 100.lua
(19.23 KiB) Downloaded 28 times
robbieyoung
 
Posts: 32
Joined: Tue Apr 21, 2015 3:12 am

Next

Return to Indicator and Signal Requests

Who is online

Users browsing this forum: Google [Bot] and 41 guests