Reply

How to close partial position in new AlgoWizard

10 replies

hendrixjl

Customer, bbp_participant, community, sq-ultimate, 3 replies.

Visit profile

3 years ago #269032

Please explain how to close partial positions in the AlgoWizard within StrategyQuantX Ultimate. In the previous EA Wizard it was easy to program close “one-half position and move stop to break even”. In the new version, close position seem to only allow for closing full position size.

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

3 years ago #269052

Hello,

the support for this has to be added yet. It is planned. Temporarily it can be solved be opening 2 orders both using different exit method. Let me know if any help needed

0

hendrixjl

Customer, bbp_participant, community, sq-ultimate, 3 replies.

Visit profile

3 years ago #269066

Thank you for the update, Tomas.

0

Paresh Joshi

Subscriber, bbp_participant, 1 replies.

Visit profile

8 months ago #283369

This feature was planned 2 years ago. Still algo wizard does not have this – its important feature. Not sure the reason as in terms of complexity, strategyqant and algowizards are quite advanced. This feature is like nothing. Is it just due to lack of interest. If so, please be aware that, its extremely useful feature and must have.

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

8 months ago #283380

Unfortunately there are so many requests for new features in SQX. it is not an easy task to add all.

Currently the only way to achieve this is to open multiple orders in the first place. Then you can manage them separately and close position partially

0

phil110

Subscriber, bbp_participant, customer, community, sq-ultimate, 6 replies.

Visit profile

6 months ago #283780

Good Afternoon, since SQX does not do partial close, I am trying the multiple order open/close idea.  In Algowizard, is this the correct implementation?  I am using Metatrader 5.

1.  In the Long Entry action, use 2x Enter-at-Limit blocks, each with order size = 1 and a unique variable for Magic Number.  1st order can be “11111”, 2nd order is “22222”.

2.  I have 2x Long Exit rules, LE1 and LE2.  In each one, there is a Close-Position block that only uses the one intended Magic Number (could be either 11111 or 22222).  And for the close order size, the quantity is “full position” for that single Magic Number.

Will this work?  So far I can backtest it and save it, but when I reopen it the 2nd entry order block is gone, the unique variables are gone and they only say “Magic Number”.

Let me know if this is too complex for Algowizard to handle.

Thanks,
Phil

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

6 months ago #283792

Hello,

yes, this should work as supposed

0

phil110

Subscriber, bbp_participant, customer, community, sq-ultimate, 6 replies.

Visit profile

6 months ago #283812

Hi, it looks like this method works on the backtest and is able to save and be re-opened without issues.  I’m using 2 orders with different Magic Numbers for a Long Entry (see pictures).

– 1st order has 1.5*ATR stop loss, and 1.5*ATR profit target
– 2nd order has 1.5*ATR stop loss, and 3.0*ATR profit target

This is ok, but I gave the 2nd order extra benefit with a “Move SL to BE” when the        1.5*ATR level is reached.  This makes the whole thing work very close to a simple scaling strategy.

Here is the problem – if I have any additional take profit / close / stop loss actions that happen outside of EnterAtMarket action, the algo doesn’t “see” it.  I would like to make a scaling strategy with multiple take profits, and I can only do that by adding more “Rules” tabs.

In AlgoWizard, does the program only look for trade signals inside a “Signals” rule type?  Basically, can you explain to me the difference in how AlgoWizard triggers the following rules?

– If-Then
– If-Then-Else
– Action only
– Signals

(I don’t care about fuzzy logic for now)

Thanks,
Phil

Attachments:
You must be logged in to view attached files.

0

phil110

Subscriber, bbp_participant, customer, community, sq-ultimate, 6 replies.

Visit profile

6 months ago #283814

Good Evening, I have another question – what is this error message when trying to backtest:

 

“com.strategyquant.tradinglib.strategy.xml.xmlstrategyexception

Cannot create strategy from XML!  Error while parsing rule ‘LPT1’ – Block has an unallowed name ‘Category’ ”

Where is this ‘Category’ and how do I adjust that?  I’ve attached a screenshot to give a view into the complexity of my algo.

Thanks,
Phil

Attachments:
You must be logged in to view attached files.

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

6 months ago #283825

can you explain to me the difference in how AlgoWizard triggers the following rules?

– If-Then
– If-Then-Else
– Action only
– Signals

If-Then simply checks the condition. If true then it executes actions defined.

The If-Then-Else allows you to set actions in case the if condition is not true.

The Action only tab is mean to be used when there is no condition and you simply needs to calculate something for example like a variable value etc.

Signals are meant to be set to represent complex sets of rules that are evaluate as boolean TRUE / FALSE

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

6 months ago #283826

Good Evening, I have another question – what is this error message when trying to backtest:

 

“com.strategyquant.tradinglib.strategy.xml.xmlstrategyexception

Cannot create strategy from XML!  Error while parsing rule ‘LPT1’ – Block has an unallowed name ‘Category’ ”

Where is this ‘Category’ and how do I adjust that?  I’ve attached a screenshot to give a view into the complexity of my algo.

Thanks,
Phil

Can you please share your strategy? We could check it. Also let me know which SQX version you currently run (builder number can be found at the application bottom)

0

Viewing 10 replies - 1 through 10 (of 10 total)