Dukascopy
 
 
Wiki JStore Search Login

Still learning, this time a more complex strategy
 Post subject: Still learning, this time a more complex strategy Post rating: 0   New post Posted: Sun 18 Oct, 2015, 15:51 

User rating: 0
Joined: Mon 06 Jul, 2015, 16:52
Posts: 14
Location: DenmarkDenmark
Hi

Still fooling around with the VisualJForex, and I have run into another problem.

The strategy is supposed to do the following
1: Use EMA to check for trend (Havent figured out how to check the slope of the EMA, so at this stage the strategy only checks if the candle max is below EMA for long, or if candle min is above for short).
2: check different charts to see if the candle corresponds with trend in 1 (green candle for long, red for short).
3: Check to see if the market is moving via MacD
4: Trade exit: When in profit, take profit when the color of specific chart (trade chart) candle changes. (havent set up the "when in profit" part yet.)

The strategy is opening just fine. The problem comes with the trade exit. It need to check the candle after the candle in which the trade is made (and subsequent candles), and only when that candle is closed (so if say a long trade is in profit, and a red candle is made, the program closes the trade, if a green candle is made, the trade stays open until a red candle is made).

I have tried a lot of ways to get the exact time of the opened trade, so I can make the system "wait" one candle, but its not working. Get time unit only works in either day (1-31) hour (1-24) minute (1-60) etc, so how can I set up an system that compares day and time of day, so I dont end up making "if" statements comparing only one time aspect at a time, such as hour of day (works ok the same day, but next day the system will only check candles after the hour set the day before).


Attachments:
Trend_Trading.vfs [57.91 KiB]
Downloaded 113 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: Still learning, this time a more complex strategy Post rating: 0   New post Posted: Tue 20 Oct, 2015, 16:43 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Hi,

Quote:
1: Use EMA to check for trend (Havent figured out how to check the slope of the EMA, so at this stage the strategy only checks if the candle max is below EMA for long, or if candle min is above for short).

For this you need to use 2 EMAs blocks with one shifted and the other retrieving the current value (0). You'll be able to compare the outputs of each EMA and then determine the trend.
Quote:
2: check different charts to see if the candle corresponds with trend in 1 (green candle for long, red for short).

You're already doing it right but some adjustments are needed.
Quote:
The strategy is opening just fine. The problem comes with the trade exit. It need to check the candle after the candle in which the trade is made (and subsequent candles), and only when that candle is closed (so if say a long trade is in profit, and a red candle is made, the program closes the trade, if a green candle is made, the trade stays open until a red candle is made).

I'll provide you with a version that performs that asap.

Overall, your strategy is using multi-time frames and you need to bear in mind that a serial connection could block the flow. Also, the first check of open positions is blocking the strategy when a position is created so you need to move this filter down so that the closing conditions can be executed otherwise it wont.

Speak soon ...


 
 Post subject: Re: Still learning, this time a more complex strategy Post rating: 0   New post Posted: Wed 21 Oct, 2015, 16:07 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Hi there,

Please test this example and modify as per you needs as I did not check in details the entry conditions.

Cheers


Attachments:
Simon_Strat.vfs [53.99 KiB]
Downloaded 133 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: Still learning, this time a more complex strategy Post rating: 0   New post Posted: Fri 23 Oct, 2015, 19:10 

User rating: 0
Joined: Mon 06 Jul, 2015, 16:52
Posts: 14
Location: DenmarkDenmark
Thank you :) Ill play around with it.


 

Jump to:  

  © 1998-2025 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com